remove match and watch helpers from room state
This commit is contained in:
parent
407bc6f6b5
commit
9d9bacb8c9
2 changed files with 3 additions and 18 deletions
|
|
@ -32,20 +32,3 @@ func _state_update(_delta: float) -> void:
|
||||||
|
|
||||||
func _state_physics_update(_delta: float) -> void:
|
func _state_physics_update(_delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
func match_state(exclude: Array[StringName] = []) -> StringName:
|
|
||||||
if Input.is_action_just_pressed("pause"):
|
|
||||||
if PAUSED in exclude: return ""
|
|
||||||
return PAUSED
|
|
||||||
|
|
||||||
return ""
|
|
||||||
|
|
||||||
|
|
||||||
func watch_state(exclude: Array[StringName] = [], data: Dictionary[StringName, Variant] = {}) -> bool:
|
|
||||||
var next_state: StringName = match_state(exclude)
|
|
||||||
if next_state != "":
|
|
||||||
finished.emit(next_state, data)
|
|
||||||
return true
|
|
||||||
|
|
||||||
return false
|
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@ func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
|
||||||
|
|
||||||
func _state_physics_update(delta: float) -> void:
|
func _state_physics_update(delta: float) -> void:
|
||||||
room.camera.follow_player(delta)
|
room.camera.follow_player(delta)
|
||||||
if match_state([PLAYING]): return
|
|
||||||
|
if Input.is_action_just_pressed("pause"):
|
||||||
|
finished.emit(PAUSED)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue