Player 👍
This commit is contained in:
parent
a046ae5288
commit
0ffc2b2497
5 changed files with 2101 additions and 12 deletions
|
|
@ -31,6 +31,8 @@ func _ready() -> void:
|
|||
push_warning("Child of weapon system is not ability or weapon")
|
||||
|
||||
current_usable = default_pistol
|
||||
slots["knife"] = default_knife
|
||||
slots["secondary"] = default_pistol
|
||||
current_usable.enter()
|
||||
|
||||
func can_add(slot: StringName) -> bool:
|
||||
|
|
@ -47,9 +49,8 @@ func add(usable: Usable, slot: StringName) -> void:
|
|||
|
||||
|
||||
func switch(to: StringName):
|
||||
if slots.has(to) == false or slots[to] == null:
|
||||
if slots.has(to) == false or slots[to] == null or slots[to] == current_usable:
|
||||
return
|
||||
|
||||
current_usable.exit()
|
||||
current_usable.in_use = false
|
||||
current_usable = slots[to]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue