IEnumerator JumpPhaseChanger() { jumpPhase = JumpPhases.Up; yield return(new WaitForSeconds(0.2f)); jumpPhase = JumpPhases.Down; yield return(new WaitForSeconds(0.2f)); jumpPhase = JumpPhases.Idle; }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); jumpPhase = JumpPhases.Idle; var fly = this.gameObject.GetComponent("Fly"); if (fly) { Destroy(fly); } }