buckshotroulette-decomp/DefibBlade.gd
2024-01-20 16:17:43 +04:00

18 lines
500 B
GDScript

class_name DefibBlade extends Node
@export var anim : AnimationPlayer
@export var speaker : AudioStreamPlayer2D
@export var sound_open : AudioStream
@export var sound_close : AudioStream
@export var wire_normal : Node3D
@export var wire_broken : Node3D
func Blade(state : String, playSound : bool):
anim.play(state)
if (state == "open"): speaker.stream = sound_open
else:
speaker.stream = sound_close
wire_normal.visible = false
wire_broken.visible = true
if (playSound): speaker.play()