Basic weapon slots system
This commit is contained in:
parent
12cb74ba2c
commit
22a72e572e
7 changed files with 115 additions and 15 deletions
14
base/scripts/player/weapon_slot.gd
Normal file
14
base/scripts/player/weapon_slot.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends Node3D
|
||||
|
||||
class_name WeaponSlot
|
||||
|
||||
var has_weapon = false
|
||||
var weapon: Weapon
|
||||
|
||||
func _ready():
|
||||
has_weapon = get_child_count() > 0
|
||||
|
||||
if has_weapon:
|
||||
var child = get_child(0)
|
||||
assert(child is Weapon)
|
||||
weapon = child as Weapon
|
Loading…
Add table
Add a link
Reference in a new issue