feat(Emitter): 给发射器添加了一个字段控制初始是否发射

This commit is contained in:
2025-10-26 10:19:48 +08:00
parent 8bd5849cd1
commit fdcae95e23

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -9,6 +10,7 @@ namespace Script.Gameplay.Facility
public class EmitterController : BaseFacilityController
{
[Header("发射器设置")]
[SerializeField] private bool isEmittingOnStart = false;
[SerializeField] private GameObject prefabToEmit;
[SerializeField] private Transform emitPoint;
[SerializeField] private Vector3 emitDirection = Vector3.forward;
@@ -19,6 +21,14 @@ namespace Script.Gameplay.Facility
private Coroutine emitCoroutine;
private void Start()
{
if (isEmittingOnStart)
{
emitCoroutine = StartCoroutine(EmitRoutine());
}
}
// 接收信号
public override void OnSignalReceived(bool active, GameObject sender)
{