STRINGS for easier text management
This commit is contained in:
parent
8e2a2d08f0
commit
352ab75841
13 changed files with 140 additions and 112 deletions
|
|
@ -4,6 +4,8 @@ const SLIDE_DURATION := 0.25
|
|||
const UP_DURATION := 0.1
|
||||
const HOLD_DURATION := 0.05
|
||||
const DOWN_DURATION := 0.18
|
||||
const ENTRY_OFFSET := 0.5
|
||||
const ENTRY_DURATION := 0.5
|
||||
|
||||
var _open_button: Node3D
|
||||
var _close_button: Node3D
|
||||
|
|
@ -25,10 +27,19 @@ func _ready() -> void:
|
|||
_rest_y = position.y
|
||||
_target_button = _close_button
|
||||
position = Vector3(_close_rest_x, _rest_y, position.z)
|
||||
visible = false
|
||||
print("[VirtuaHand] close_x=", _close_rest_x, " open_x=", _open_rest_x, " hand_pos=", position)
|
||||
|
||||
EventBus.button_pressed.connect(_animate_press)
|
||||
EventBus.active_button_changed.connect(_on_active_button_changed)
|
||||
EventBus.intro_finished.connect(_on_intro_finished)
|
||||
|
||||
func _on_intro_finished() -> void:
|
||||
var sprite_height := texture.get_height() * pixel_size * scale.y
|
||||
position.y = _rest_y - sprite_height - ENTRY_OFFSET
|
||||
visible = true
|
||||
var entry_tween := create_tween()
|
||||
entry_tween.tween_property(self, "position:y", _rest_y, ENTRY_DURATION).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
|
||||
func _project_to_hand_plane(button: Node3D) -> float:
|
||||
var cam := get_viewport().get_camera_3d()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue