using Godot; using System; using System.Collections.Generic; using System.Linq; public partial class ResourceLoader { public static PackedScene LoadLayerPrefab() { return GD.Load($"res://Prefabs/Layer.tscn"); } public static PackedScene LoadRobotPrefab() { return GD.Load($"res://Prefabs/Robot.tscn"); } public static PackedScene LoadProgramNodePrefab() { return GD.Load($"res://Prefabs/ProgramNode.tscn"); } public static Dictionary LoadTiles() { Dictionary tileMeshes = new Dictionary(); PackedScene tileCollection = GD.Load($"res://Assets/Objects/Tiles.glb"); Node root = tileCollection.Instantiate(); foreach (MeshInstance3D child in root.GetChildren()) { tileMeshes.Add(child.Name.ToString().ToLower(), child); } return tileMeshes; } public static Dictionary LoadDecorations() { Dictionary decorationMeshes = new Dictionary(); PackedScene decorationCollection = GD.Load($"res://Assets/Objects/Decorations.glb"); Node root = decorationCollection.Instantiate(); foreach (MeshInstance3D child in root.GetChildren()) { decorationMeshes.Add(child.Name.ToString().ToLower(), child); } return decorationMeshes; } }