private void WallJump() { if (touchedWall && playerStamina.DeductStamina(WallJumpCost)) { touchedWall = false; playerMove.Direction = wallNormal; playerMove.AutoMove = true; playerMove.AutoMoveSpeed = playerMove.Speed; yspeed = JumpSpeed * WallJumpFactor; } }
// Coroutine to roll for a given period private IEnumerator Roll() { if (playerStamina.DeductStamina(RollStaminaCost)) { AutoMove = true; AutoMoveSpeed = RollSpeed; rolling = true; // Roll for a certain time period yield return(new WaitForSeconds(RollTime)); StopRoll(); } }