Added decoration assets and placement. Currently all placeholders are replaced, need to implement a chance based system.
This commit is contained in:
@@ -2,7 +2,7 @@ using Godot;
|
||||
|
||||
public class Placeholder
|
||||
{
|
||||
string name;
|
||||
public string name;
|
||||
public Vector3 pos;
|
||||
|
||||
public Placeholder(string name, Vector3 pos){
|
||||
|
||||
@@ -27,4 +27,17 @@ public partial class ResourceLoader
|
||||
|
||||
return tileMeshes;
|
||||
}
|
||||
|
||||
public static Dictionary<string, MeshInstance3D> LoadDecorations()
|
||||
{
|
||||
Dictionary<string, MeshInstance3D> decorationMeshes = new Dictionary<string, MeshInstance3D>();
|
||||
PackedScene decorationCollection = GD.Load<PackedScene>($"res://Assets/Objects/Decorations.glb");
|
||||
Node root = decorationCollection.Instantiate();
|
||||
foreach (MeshInstance3D child in root.GetChildren())
|
||||
{
|
||||
decorationMeshes.Add(child.Name.ToString().ToLower(), child);
|
||||
}
|
||||
|
||||
return decorationMeshes;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user