despawn runner or chaser on disconnect

This commit is contained in:
2025-02-21 17:59:23 +09:00
parent 591225996d
commit ca63d4594c
15 changed files with 85 additions and 97 deletions
+4 -19
View File
@@ -9,42 +9,27 @@ func set_subject(new_subject: Node) -> void:
state.subject = subject
func _change_state(new_state: State) -> void:
if current_state:
#print("Exiting: %s" % current_state.name)
current_state.exit()
if current_state: current_state.exit()
current_state = new_state
#print("Entering: %s" % current_state.name)
current_state.enter()
func process_physics(delta: float) -> void:
if not current_state:
return
if not current_state.subject:
return
if not current_state or not current_state.subject: return
var new_state = current_state.process_physics(delta)
if new_state:
_change_state(new_state)
func process_input(event: InputEvent) -> void:
if not current_state:
return
if not current_state.subject:
return
if not current_state or not current_state.subject: return
var new_state = current_state.process_input(event)
if new_state:
_change_state(new_state)
func process_frame(delta: float) -> void:
if not current_state:
return
if not current_state.subject:
return
if not current_state or not current_state.subject: return
var new_state = current_state.process_frame(delta)
if new_state: