-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCompartmentManager.gd
49 lines (40 loc) · 1.32 KB
/
CompartmentManager.gd
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
40
41
42
43
44
45
46
47
48
49
class_name CompartmentManager extends Node
@export var animator_compartment : AnimationPlayer
@export var animator_briefcase : AnimationPlayer
@export var speaker_briefcase : AudioStreamPlayer2D
@export var speaker_main : AudioStreamPlayer2D
@export var soundArray_briefcase : Array[AudioStream]
@export var soundArray_main : Array[AudioStream]
var isHiding_items = true
var toggle = false
var toggle2 = false
func _ready():
animator_compartment.play("RESET")
animator_briefcase.play("RESET")
func PlaySound_ShowBriefcase():
speaker_briefcase.stream = soundArray_briefcase[0]
speaker_briefcase.play()
func PlaySound_HideBriefcase():
speaker_briefcase.stream = soundArray_briefcase[1]
speaker_briefcase.play()
func PlaySound_ClearItems():
speaker_main.stream = soundArray_main[0]
speaker_main.play()
func PlaySound_ShowItems():
speaker_main.stream = soundArray_main[1]
speaker_main.play()
func PlaySound_HideItems():
speaker_main.stream = soundArray_main[2]
speaker_main.play()
func CycleCompartment(alias : String):
match (alias):
"show items":
animator_compartment.play("show items")
isHiding_items = false
"hide items":
animator_compartment.play("hide items")
isHiding_items = true
"show briefcase":
animator_briefcase.play("show briefcase")
"hide briefcase":
animator_briefcase.play("hide briefcase")