Refactor Part II
This commit is contained in:
parent
cd20f952ce
commit
3f99f1b8dd
56 changed files with 193 additions and 168 deletions
|
|
@ -25,6 +25,7 @@ class_name WeaponSubStateMachine
|
|||
remaining_ammo = 0
|
||||
else:
|
||||
remaining_ammo = value
|
||||
ammo_updated.emit()
|
||||
|
||||
@export var speed_modifier: float = 1.0
|
||||
@export var can_be_previous: bool = true
|
||||
|
|
@ -52,6 +53,16 @@ func _ready() -> void:
|
|||
child.machine = self
|
||||
child.transition.connect(on_transition_required)
|
||||
child.return_to_previous.connect(request_return.emit)
|
||||
|
||||
var parent = get_parent()
|
||||
if parent is WeaponSystem:
|
||||
system = parent
|
||||
animation_player = system.animation_player
|
||||
player_camera = system.camera
|
||||
player = system.player
|
||||
request_return.connect(system.return_to_previous)
|
||||
ammo_depleted.connect(system.check_for_empty)
|
||||
ammo_updated.connect(system.on_ammo_updated)
|
||||
|
||||
func enter() -> void:
|
||||
super()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue