gate info

This commit is contained in:
Nordup 2024-12-03 11:10:50 +04:00
parent 71b8d06c69
commit a425178538
10 changed files with 177 additions and 72 deletions

View file

@ -0,0 +1,25 @@
extends AnimationPlayer
@export var ui_events: UiEvents
@export var gate_events: GateEvents
const RESET := "RESET"
const INITIAL := "initial"
const FOCUSED := "focused"
var focused := false
func _ready() -> void:
ui_events.ui_mode_changed.connect(on_ui_mode_changed)
gate_events.open_gate.connect(func(_url): on_ui_mode_changed(UiEvents.UiMode.INITIAL))
func on_ui_mode_changed(mode: UiEvents.UiMode) -> void:
if mode == UiEvents.UiMode.INITIAL and focused:
focused = false
play(INITIAL)
if mode == UiEvents.UiMode.FOCUSED and not focused:
focused = true
play(FOCUSED)