using Core.Utility; using Fort23.Core; using Fort23.UTool; using UnityEngine; namespace Fort23.Mono { public class UseSkillShowFxMono : CObject { protected BesselPathGroup besselPathGroup; protected ParticleSystemPool gObjectPoolInterface; protected float _currTime; protected float _timeAdd; private float _speed =3; public void Init(BesselPathGroup besselPathGroup, ParticleSystemPool gObjectPoolInterface) { besselPathGroup.Start(); this.besselPathGroup = besselPathGroup; this.gObjectPoolInterface = gObjectPoolInterface; _currTime = 0; _timeAdd = 1.0f /3; StaticUpdater.Instance.AddRenderUpdateCallBack(Update); } public void Update() { _currTime += Time.deltaTime*_timeAdd; Vector3 pos = besselPathGroup.CalculatePoint(_currTime); gObjectPoolInterface.gameObject.transform.position = pos; if (_currTime >= 1) { CObjectPool.Instance.Recycle(this); } } public override void ActiveObj() { } public override void DormancyObj() { GObjectPool.Instance.Recycle(gObjectPoolInterface); besselPathGroup = null; gObjectPoolInterface = null; StaticUpdater.Instance.RemoveRenderUpdateCallBack(Update); } } }