Add autoload engine context
This commit is contained in:
parent
d3dd40eec3
commit
ef2f87af20
|
@ -15,6 +15,10 @@ run/main_scene="res://project/scenes/main.tscn"
|
||||||
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
|
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
Context="*res://project/code/TMV/Context.cs"
|
||||||
|
|
||||||
[dotnet]
|
[dotnet]
|
||||||
|
|
||||||
project/assembly_name="Thief Mission Viewer"
|
project/assembly_name="Thief Mission Viewer"
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
using Godot;
|
||||||
|
using KeepersCompound.LGS;
|
||||||
|
|
||||||
|
namespace KeepersCompound.TMV;
|
||||||
|
|
||||||
|
public partial class Context : Node
|
||||||
|
{
|
||||||
|
public static Context Instance { get; private set; }
|
||||||
|
|
||||||
|
public ResourcePathManager PathManager { get; private set; }
|
||||||
|
public ModelLoader ModelLoader { get; private set; }
|
||||||
|
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
var extractPath = ProjectSettings.GlobalizePath($"user://extracted/tmp");
|
||||||
|
PathManager = new ResourcePathManager(extractPath);
|
||||||
|
ModelLoader = new ModelLoader(PathManager);
|
||||||
|
|
||||||
|
Instance = this;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue