// Update is called once per frame void Update() { PrevState = state; state = GamePad.GetState(playerIndex); if (m_CanSuperDash) { this.GetComponent <Player_Dash>().IsInSuperDash(true); } else { this.GetComponent <Player_Dash>().IsInSuperDash(false); } if (PrevState.Buttons.A == ButtonState.Released && state.Buttons.A == ButtonState.Pressed && m_CanSuperDash) { if (m_CanSuperDashAgain) { StopAllCoroutines(); m_CanSuperDashAgain = false; m_PlayerMoveScript.SetPath(false); m_Trail.enabled = true; StartCoroutine(MovementDash()); StartCoroutine(TimeToSuperDashAgain()); } } }
// Update is called once per frame void Update() { PrevState = state; state = GamePad.GetState(playerIndex); if (PrevState.Buttons.A == ButtonState.Released && state.Buttons.A == ButtonState.Pressed && m_CanDash && !m_IsSuperDash) { if (m_CanDashAgain) { m_CanDashAgain = false; m_PlayerMoveScript.SetPath(false); m_Trail.enabled = true; StartCoroutine(MovementDash()); } } }