Added WFC and respective parts (Tile, World, Layer, WFC, ResourceLoader)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
public partial class ResourceLoader
|
||||
{
|
||||
|
||||
public static PackedScene LoadLayerPrefab()
|
||||
{
|
||||
return GD.Load<PackedScene>($"res://Prefabs/Layer.tscn");
|
||||
}
|
||||
|
||||
public static Dictionary<string, MeshInstance3D> LoadTiles()
|
||||
{
|
||||
Dictionary<string, MeshInstance3D> tileMeshes = new Dictionary<string, MeshInstance3D>();
|
||||
PackedScene tileCollection = GD.Load<PackedScene>($"res://Assets/Objects/Tiles.glb");
|
||||
Node root = tileCollection.Instantiate();
|
||||
foreach (MeshInstance3D child in root.GetChildren())
|
||||
{
|
||||
tileMeshes.Add(child.Name.ToString().ToLower(), child);
|
||||
}
|
||||
|
||||
return tileMeshes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user