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;