GodotShade/activation.gd
Guillaume Vern 5733a3b043 smooth mesh
2025-11-28 01:51:14 +01:00

27 lines
624 B
GDScript

@tool
extends Node3D
enum EnumWorld {CUBIC_WORLD, SMOOTH_WORLD}
@export var wanted_world: EnumWorld
var enabled_world: EnumWorld = EnumWorld.CUBIC_WORLD
var smooth_world = preload("res://smooth_world.tscn")
var cubic_world = preload("res://cubic_world.tscn")
signal change_world
func _process(_delta: float) -> void:
if enabled_world != wanted_world:
print("changing world")
emit_signal("change_world")
func _on_change_world():
match wanted_world:
EnumWorld.CUBIC_WORLD:
add_child(cubic_world.instantiate())
EnumWorld.SMOOTH_WORLD:
add_child(smooth_world.instantiate())
enabled_world = wanted_world