/// <summary> /// Destroy all temporary spell objects created by this cast. /// </summary> public void CleanUp(bool dontDestroy = false) { //SpellGameObjectManager.Instance.RemoveComponent (this); if (CastPhase != null) { CastPhase.CleanUp(); ObjectManager.Instance.Recycle(CastPhase); CastPhase = null; } if (ProjectilePhase != null) { ProjectilePhase.CleanUp(); ObjectManager.Instance.Recycle(ProjectilePhase); ProjectilePhase = null; } if (ImpactPhase != null) { ImpactPhase.CleanUp(); ObjectManager.Instance.Recycle(ImpactPhase); ImpactPhase = null; } Targets.CleanUp(); if (!dontDestroy) { GameObjectManager.Instance.RemoveComponent(this); } }
void EndCastPhase() { CastPhase.NotifyEnd(); StartProjectilePhase(); }