ErikOverflow/SimpleIncremental

Migrate pausing functionality to a singleton GameSpeed manager

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Currently pausing occurs within the InventoryUI script, and the WeaponMelee/WeaponMelee Controllers check the timescale value to determine if the game is paused. This is obfuscating the functionality and can confuse those unfamiliar with the project.

Describe the solution you'd like
Create a singleton GameSpeed manager that contains an Enum for GameSpeed (Paused, NormalSpeed), as well as a public PauseGame() and UnPauseGame() methods that sets Time.timeScale to 0. Update InventoryUI to invoke the Pause/Unpause methods and the Weapon Controllers to check the GameSpeed instead of directly comparing against Time.timeScale.

Additional context
You will need to modify InventoryUI, WeaponMeleeController, and WeaponRangedController