feat: interactive handling for player now type safe
This commit is contained in:
parent
3973a2cfb7
commit
f04aa0cff2
|
|
@ -241,8 +241,9 @@ func _input(event:InputEvent) -> void:
|
||||||
|
|
||||||
if event.is_action_pressed("collect_memento_ui") or event.is_action_pressed("option_memento_ui"):
|
if event.is_action_pressed("collect_memento_ui") or event.is_action_pressed("option_memento_ui"):
|
||||||
if focus_ray.is_colliding():
|
if focus_ray.is_colliding():
|
||||||
if focus_ray.get_collider().has_method("handle"):
|
var collider := focus_ray.get_collider()
|
||||||
focus_ray.get_collider().handle(event)
|
if collider is InteractiveSprite:
|
||||||
|
collider.handle(event)
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
if event.is_action_pressed("crouch"):
|
if event.is_action_pressed("crouch"):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue