Pauser Added + Fixed Bug
TODO: Stop Animations when Paused
This commit is contained in:
@@ -102,6 +102,9 @@ namespace Player
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (IsPaused)
|
||||
return;
|
||||
|
||||
//Took from tutorial : https://www.youtube.com/watch?v=7KiK0Aqtmzc
|
||||
switch (_playerRigidbody2D.velocity.y)
|
||||
{
|
||||
@@ -136,6 +139,9 @@ namespace Player
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (IsPaused)
|
||||
return;
|
||||
|
||||
_isOnAir = !_playerGroundTrigger.IsCollided;
|
||||
RespawnCheck();
|
||||
|
||||
@@ -156,13 +162,13 @@ namespace Player
|
||||
public void Pause()
|
||||
{
|
||||
IsPaused = true;
|
||||
_playerRigidbody2D.simulated = IsPaused;
|
||||
_playerRigidbody2D.simulated = !IsPaused;
|
||||
}
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
IsPaused = false;
|
||||
_playerRigidbody2D.simulated = IsPaused;
|
||||
_playerRigidbody2D.simulated = !IsPaused;
|
||||
}
|
||||
|
||||
// MOVE METHODS
|
||||
@@ -292,5 +298,9 @@ namespace Player
|
||||
}
|
||||
|
||||
public void Clop() => clop.PlayClop();
|
||||
|
||||
public void OnPause(InputAction.CallbackContext context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user