-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAnimationPlayer.gd
More file actions
39 lines (36 loc) · 867 Bytes
/
AnimationPlayer.gd
File metadata and controls
39 lines (36 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
extends AnimationPlayer
@onready var MenuAnim = $"."
@onready var Menu = $".."
var iMenuPressed = 0
var pressed = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if iMenuPressed == 0:
if pressed == true:
MenuAnim.stop()
MenuAnim.play('close')
pressed = false
print("ANIMATION CLOSE")
else:
if iMenuPressed == 1:
if pressed == true:
MenuAnim.stop()
MenuAnim.play("open")
pressed = false
print("ANIMATION OPEN")
pass
func _on_button_pressed():
print("PRESSED")
if iMenuPressed == 0:
pressed = true
iMenuPressed = 1
print("OFF")
else:
if iMenuPressed == 1:
pressed = true
iMenuPressed = 0
print("ON")
pass # Replace with function body.