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

25 lines
573 B
C#
Raw Normal View History

2024-08-17 19:53:16 +00:00
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;
2024-08-17 19:53:16 +00:00
}
public void BuildModel(string campaignName, string modelPath)
2024-08-17 19:53:16 +00:00
{
foreach (var node in GetChildren())
{
node.QueueFree();
}
var model = Context.Instance.ModelLoader.Load(campaignName, modelPath);
AddChild(model);
2024-08-17 19:53:16 +00:00
}
}