tweaks to assassinate vip mode
This commit is contained in:
@@ -12,6 +12,7 @@ signal switch_changed
|
||||
@export var anim_player : AnimationPlayer
|
||||
|
||||
var switched_on : bool
|
||||
var active = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@@ -22,14 +23,24 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func switch():
|
||||
if toggle_enabled:
|
||||
if switched_on == true:
|
||||
switched_on = false
|
||||
switch_changed.emit()
|
||||
|
||||
if anim_player != null:
|
||||
anim_player.play("off")
|
||||
|
||||
if active:
|
||||
if toggle_enabled:
|
||||
if switched_on == true:
|
||||
switched_on = false
|
||||
switch_changed.emit()
|
||||
|
||||
if anim_player != null:
|
||||
anim_player.play("off")
|
||||
|
||||
else:
|
||||
switched_on = true
|
||||
switch_changed.emit()
|
||||
|
||||
if anim_player != null:
|
||||
anim_player.play("on")
|
||||
|
||||
if timer_enabled:
|
||||
start_timer()
|
||||
else:
|
||||
switched_on = true
|
||||
switch_changed.emit()
|
||||
@@ -39,15 +50,6 @@ func switch():
|
||||
|
||||
if timer_enabled:
|
||||
start_timer()
|
||||
else:
|
||||
switched_on = true
|
||||
switch_changed.emit()
|
||||
|
||||
if anim_player != null:
|
||||
anim_player.play("on")
|
||||
|
||||
if timer_enabled:
|
||||
start_timer()
|
||||
|
||||
func start_timer():
|
||||
await get_tree().create_timer(timer_duration).timeout
|
||||
|
||||
Reference in New Issue
Block a user