Singelton patch

This commit is contained in:
2025-05-05 22:21:51 -05:00
parent 43487bb448
commit 631365aa38
46 changed files with 78 additions and 174 deletions

View File

@@ -0,0 +1,37 @@
class_name PauseSystem extends Node
enum PauseType {
# Completely unpaused
NOT_PAUSED,
# Fully paused, with no exceptions to anything
FULLY_PAUSED,
# Specific entities are paused
ENTITY_PAUSED,
# All entities are paused unless specified
CUTSCENE_PAUSED
};
var pauseType:PauseType = PauseType.NOT_PAUSED;
var entities:Array = [];
var playerPaused:bool = false;
func getPauseState() -> PauseType:
if isPlayerPaused():
return PauseType.FULLY_PAUSED;
return pauseType;
func pause(
pauseType:PauseType,
entities:Array = [],
) -> void:
self.pauseType = pauseType;
self.entities = entities;
func unpause() -> void:
self.pauseType = PauseType.NOT_PAUSED;
func isPlayerPaused() -> bool:
return playerPaused;
func playerPauseToggle() -> void:
playerPaused = !playerPaused;