forked from woofmeow/straywild
Add gathering, unified inventory, and real-time world
This commit is contained in:
parent
173371e6fc
commit
fa57edca83
113 changed files with 6700 additions and 1307 deletions
30
world/gathering/gatherable_anchor_set_3d.gd
Normal file
30
world/gathering/gatherable_anchor_set_3d.gd
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
@tool
|
||||
class_name GatherableAnchorSet3D
|
||||
extends Node3D
|
||||
|
||||
@export var anchor_set_id: StringName
|
||||
|
||||
|
||||
func get_spawn_positions() -> PackedVector3Array:
|
||||
var positions := PackedVector3Array()
|
||||
_collect_marker_positions(self, positions)
|
||||
return positions
|
||||
|
||||
|
||||
func _collect_marker_positions(
|
||||
root_node: Node,
|
||||
positions: PackedVector3Array,
|
||||
) -> void:
|
||||
for child: Node in root_node.get_children():
|
||||
if child is Marker3D:
|
||||
positions.append((child as Marker3D).global_position)
|
||||
_collect_marker_positions(child, positions)
|
||||
|
||||
|
||||
func _get_configuration_warnings() -> PackedStringArray:
|
||||
var warnings := PackedStringArray()
|
||||
if anchor_set_id.is_empty():
|
||||
warnings.append("Gatherable anchor-set ID is required.")
|
||||
if get_spawn_positions().is_empty():
|
||||
warnings.append("Add at least one Marker3D spawn anchor.")
|
||||
return warnings
|
||||
1
world/gathering/gatherable_anchor_set_3d.gd.uid
Normal file
1
world/gathering/gatherable_anchor_set_3d.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b6xfixi21qllm
|
||||
Loading…
Add table
Add a link
Reference in a new issue