Auto set_active(false) for inventory items component
This commit is contained in:
1 parent
cdf85cd1c5
commit
5d50f3e188
4 files changed
+17
-5
No files matched your search
@@ -68,4 +68,5 @@ func register_components():
|
||||
child.register(custom_data)
|
||||
|
||||
func autoload_components():
|
||||
add_child(ESCItemComponentOutline.new())
|
||||
add_child(ESCItemComponentOutline.new())
|
||||
add_child(ESCItemComponentInventoryChecker.new())
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
extends ESCItemComponent
|
||||
class_name ESCItemComponentInventoryChecker
|
||||
|
||||
func get_component_type():
|
||||
return "auto-inventory-checker"
|
||||
|
||||
func _enter_tree():
|
||||
if escoria.inventory_manager.inventory_has(get_global_id()):
|
||||
escoria.object_manager.get_object(get_global_id()).active = false
|
||||
Reference in new issue
Block a user