public override void Clean() { Destroy(spellVisual); if (speedStatus != null) { } speedStatus.OnStatusEnd(unit.GetComponent <Unit>()); if (phaseStatus != null) { phaseStatus.OnStatusEnd(unit.GetComponent <Unit>()); unit.GetComponent <UnitStatusManager>().UnRegisterTimedStatus(phaseStatus); } Destroy(gameObject); }
protected override void Update() { if (jumpTimer > 0f) { jumpTimer -= Time.deltaTime; if (jumpTimer < 0f) { if (rootStatus != null) { rootStatus.OnStatusEnd(unit.GetComponent <Unit>()); rootStatus = null; } if (phaseStatus != null) { phaseStatus.OnStatusEnd(unit.GetComponent <Unit>()); phaseStatus = null; } unit.GetComponent <Rigidbody>().velocity = new Vector3(0f, 0f, 0f); Clean(); } } }