thief-mission-viewer/project/code/TMV/Model.cs

25 lines
573 B
C#

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