Geometry Generation now in Block

This commit is contained in:
Simon Lübeß
2021-03-18 17:22:41 +01:00
parent 4e87f5f144
commit 8320689d3e
8 changed files with 280 additions and 126 deletions
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections;
namespace Sandbox.VoxelFun
{
static class Models
{
static List<Model> _models = new List<Model>() ~ DeleteContainerAndItems!(_);
public static Model Stone;
public static Model Grass;
public static Model Dirt;
public static void Init()
{
Stone = RegisterModel(Blocks.Stone, .. new BlockModel(.Gray));
Grass = RegisterModel(Blocks.Grass, .. new BlockModel(.Green));
Dirt = RegisterModel(Blocks.Dirt, .. new BlockModel(.Brown));
}
public static void RegisterModel(Block block, Model model)
{
_models.Add(model);
block.[Friend]_model = model;
}
}
}