Recoil system
This commit is contained in:
parent
1c062489b1
commit
cdfce4c7db
11 changed files with 144 additions and 8 deletions
|
|
@ -6,6 +6,7 @@ class_name WeaponSystem
|
|||
@export var default_knife: WeaponSubStateMachine
|
||||
|
||||
@export var animation_player: AnimationPlayer
|
||||
@export var camera: PlayerCamera
|
||||
|
||||
var current_state: WeaponSubStateMachine
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ func _ready() -> void:
|
|||
if child is WeaponSubStateMachine:
|
||||
child.system = self
|
||||
child.animation_player = animation_player
|
||||
child.player_camera = camera
|
||||
else:
|
||||
push_warning("Child of weapon system is not ability or weapon")
|
||||
|
||||
|
|
@ -46,6 +48,8 @@ func add(state: WeaponSubStateMachine, slot: StringName) -> void:
|
|||
|
||||
slots[slot] = state
|
||||
state.system = self
|
||||
state.animation_player = animation_player
|
||||
state.player_camera = camera
|
||||
|
||||
|
||||
func switch(to: StringName):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue