ManiaMap.Godot
Procedural generation of metroidvania style maps for Godot .NET.
PathRef.cs
1using Godot;
2
4{
5 public readonly struct PathRef
6 {
7 public string UidPath { get; }
8 public string ResPath { get; }
9
10 public PathRef(string uidPath, string resPath)
11 {
12 UidPath = uidPath;
13 ResPath = resPath;
14 }
15
16 public string GetLoadPath()
17 {
18 return ResourceLoader.Exists(ResPath) ? ResPath : UidPath;
19 }
20
21 public T Load<T>() where T : class
22 {
23 return ResourceLoader.Load<T>(GetLoadPath());
24 }
25 }
26}