using cfg; using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace game { public class ToolVacuumCleaner : ToolForFollowerAndNormalPosition { [Tooltip("循环特效")] [SerializeField] private ParticleSystem[] m_LoopEffects = null; #region 行为相关 private bool m_IsPlayingEffect = false; public override void StartExecuting() { if (m_LoopEffects == null || m_IsPlayingEffect == true) return; m_IsPlayingEffect = true; int count = m_LoopEffects.Length; for (int i = 0; i < count; i++) { m_LoopEffects[i].gameObject.SetActive(true); m_LoopEffects[i].Play(); } } public override void StopExecuting() { if (m_LoopEffects == null) return; m_IsPlayingEffect = false; int count = m_LoopEffects.Length; for (int i = 0; i < count; i++) { m_LoopEffects[i].Stop(); m_LoopEffects[i].gameObject.SetActive(false); } } #endregion #region 生命周期 public override void InitTool() { base.InitTool(); m_Type = EventWashingTool.Cleaner; m_IsPlayingEffect = false; } #endregion } }