Full controle tactile et souris
This commit is contained in:
@@ -2,11 +2,22 @@ extends Area2D
|
||||
class_name InteractionZone
|
||||
|
||||
@export var clue: BubbleClue
|
||||
var clueEnabled = false
|
||||
var player: Human
|
||||
|
||||
func enable_interaction_clue():
|
||||
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()
|
||||
|
||||
func enable_interaction_clue(h: Human):
|
||||
player = h
|
||||
clueEnabled = true
|
||||
if clue:
|
||||
clue.setVisible(true)
|
||||
clue.setVisible(clueEnabled)
|
||||
|
||||
func disable_interaction_clue():
|
||||
clueEnabled = false
|
||||
if clue:
|
||||
clue.setVisible(false)
|
||||
clue.setVisible(clueEnabled)
|
||||
|
||||
Reference in New Issue
Block a user