Skip to content

Commit

Permalink
Change SceneRef to PathRef
Browse files Browse the repository at this point in the history
  • Loading branch information
mpewsey committed Aug 15, 2024
1 parent 99b8624 commit a5be4af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions addons/mpewsey.maniamap/scripts/runtime/ManiaMapResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ public static class Enums
/// </summary>
public static class Scenes
{
public static SceneRef LayoutGraphEditorScene { get; } = new SceneRef("uid://ckyjrhwvcs6fi", "res://addons/mpewsey.maniamap/scenes/layout_graph_editor/layout_graph_editor.tscn");
public static SceneRef RoomNode2DToolbarScene { get; } = new SceneRef("uid://ceij50wkmgvyi", "res://addons/mpewsey.maniamap/scenes/room_node_2d_toolbar/room_node_2d_toolbar.tscn");
public static SceneRef RoomNode3DToolbarScene { get; } = new SceneRef("uid://b25t77npx7a3l", "res://addons/mpewsey.maniamap/scenes/room_node_3d_toolbar/room_node_3d_toolbar.tscn");
public static PathRef LayoutGraphEditorScene { get; } = new PathRef("uid://ckyjrhwvcs6fi", "res://addons/mpewsey.maniamap/scenes/layout_graph_editor/layout_graph_editor.tscn");
public static PathRef RoomNode2DToolbarScene { get; } = new PathRef("uid://ceij50wkmgvyi", "res://addons/mpewsey.maniamap/scenes/room_node_2d_toolbar/room_node_2d_toolbar.tscn");
public static PathRef RoomNode3DToolbarScene { get; } = new PathRef("uid://b25t77npx7a3l", "res://addons/mpewsey.maniamap/scenes/room_node_3d_toolbar/room_node_3d_toolbar.tscn");
}

/// <summary>
/// Contains materials.
/// </summary>
public static class Materials
{
public static SceneRef AlbedoMaterialPath { get; } = new SceneRef("uid://ppa2shs6thgv", "res://addons/mpewsey.maniamap/materials/albedo_material.tres");
public static PathRef AlbedoMaterialPath { get; } = new PathRef("uid://ppa2shs6thgv", "res://addons/mpewsey.maniamap/materials/albedo_material.tres");
public static Material AlbedoMaterial { get; } = AlbedoMaterialPath.Load<Material>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

namespace MPewsey.ManiaMapGodot
{
public readonly struct SceneRef
public readonly struct PathRef
{
public string UidPath { get; }
public string ResPath { get; }

public SceneRef(string uidPath, string resPath)
public PathRef(string uidPath, string resPath)
{
UidPath = uidPath;
ResPath = resPath;
}

public string GetLoadPath()
{
return ResourceLoader.Exists(UidPath) ? UidPath : ResPath;
return ResourceLoader.Exists(ResPath) ? ResPath : UidPath;
}

public T Load<T>() where T : class
Expand Down

0 comments on commit a5be4af

Please sign in to comment.