amélioration de la commande tactile
les clues sont dépendantes du contexte elles affichent un bouton si on est au clavier un doigt si on est à la souris ou au doigt
This commit is contained in:
@@ -4,12 +4,20 @@ class_name InteractionZone
|
||||
@export var clue: BubbleClue
|
||||
var clueEnabled = false
|
||||
var player: Human
|
||||
var hasMouseInside = false
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton or event is InputEventScreenTouch:
|
||||
if event.pressed:
|
||||
if clueEnabled:
|
||||
player.wants_to_interact_with = get_parent()
|
||||
if hasMouseInside:
|
||||
player.wants_to_interact_with = get_parent()
|
||||
|
||||
func _mouse_enter() -> void:
|
||||
hasMouseInside = true
|
||||
|
||||
func _mouse_exit() -> void:
|
||||
hasMouseInside = false
|
||||
|
||||
func enable_interaction_clue(h: Human):
|
||||
player = h
|
||||
|
||||
Reference in New Issue
Block a user