using Godot; using KeepersCompound.TMV.UI; namespace KeepersCompound.TMV; public partial class Model : Node3D { public override void _Ready() { var resourceSelector = GetNode("%ResourceSelector") as ResourceSelector; resourceSelector.ResourceSelected += BuildModel; } public void BuildModel(string campaignName, string modelPath) { foreach (var node in GetChildren()) { node.QueueFree(); } Context.Instance.SetCampaign(campaignName); var model = Context.Instance.ModelLoader.Load(modelPath); AddChild(model); } }