23 lines
572 B
GDScript
23 lines
572 B
GDScript
extends PanelContainer
|
|
|
|
var shapeButtonScene = preload("res://UI/SelectableShape/ShapeButton.tscn")
|
|
|
|
var initialShapes = [
|
|
preload("res://models/horse.glb"),
|
|
preload("res://models/shark.glb")
|
|
]
|
|
|
|
var offset = Vector3(0, 10000, 10000)
|
|
|
|
func _ready() -> void:
|
|
setup_buttons()
|
|
|
|
func setup_buttons():
|
|
for shape in initialShapes:
|
|
var newButton = shapeButtonScene.instantiate()
|
|
var buttonObject = shape.instantiate()
|
|
%ShapeButtons.add_child(newButton)
|
|
newButton.set_location_offset(offset)
|
|
offset += Vector3(0, 10000, 10000)
|
|
newButton.change_object(buttonObject)
|