GodotComponentTest/components/WorldInfoComponent.cs

15 lines
351 B
C#

using Godot;
public class WorldInfoComponent : Component {
[Export] public NodePath WorldPath;
public World World;
// Called when the node enters the scene tree for the first time.
public override void _Ready() {
World = GetNode<World>(WorldPath);
}
public void SetWorld(World world) {
World = world;
}
}