Animation Pauses

This commit is contained in:
2022-02-26 20:00:03 +03:00
parent caab797e6d
commit 5444ba8f1c
4 changed files with 29 additions and 6 deletions

View File

@@ -162,13 +162,19 @@ namespace Player
public void Pause()
{
IsPaused = true;
_playerRigidbody2D.simulated = !IsPaused;
UpdateComponents();
}
public void Resume()
{
IsPaused = false;
UpdateComponents();
}
private void UpdateComponents()
{
_playerRigidbody2D.simulated = !IsPaused;
animator.enabled = !IsPaused;
}
// MOVE METHODS