You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
529 B
GDScript
23 lines
529 B
GDScript
|
2 years ago
|
extends Control
|
||
|
|
class_name LockItem
|
||
|
|
|
||
|
|
@onready var animation = $AnimationPlayer as AnimationPlayer
|
||
|
|
@onready var camera: CameraManager = Global.camera_mgr
|
||
|
|
|
||
|
|
var target_id : int
|
||
|
|
|
||
|
|
func _ready():
|
||
|
|
SignalManager.character_ui_pos_changed.connect(on_character_ui_pos_changed)
|
||
|
|
animation.play("rotate")
|
||
|
|
|
||
|
|
func on_level_loading_start():
|
||
|
|
animation.play("start")
|
||
|
|
|
||
|
|
func on_level_loading_end():
|
||
|
|
animation.play("end")
|
||
|
|
|
||
|
|
func on_character_ui_pos_changed(id:int,pos:Vector3):
|
||
|
|
if id != target_id:
|
||
|
|
return
|
||
|
|
position = camera.get_screen_pos(pos)
|