static void UpdateNeighbors(VoxelStorage.Point point, Element element) { var neighbors = new VoxelStorage.Vector[] { new VoxelStorage.Vector { x = 0, y = 0, z = -1 }, new VoxelStorage.Vector { x = 0, y = 0, z = 1 }, new VoxelStorage.Vector { x = 0, y = -1, z = 0 }, new VoxelStorage.Vector { x = 0, y = 1, z = 0 }, new VoxelStorage.Vector { x = -1, y = 0, z = 0 }, new VoxelStorage.Vector { x = 1, y = 0, z = 0 }, }; foreach (var neighbor in neighbors) { var transmutable = VoxelStorage.instance.Lookup(point + neighbor); if (transmutable != null) { Debug.Log("Enqueue " + (point + neighbor) + " " + element + " from " + point); TransmutableUpdater.instance.Enqueue(transmutable, element); } } }
public void InitBranch(int height, int branchDepth, VoxelStorage.Vector direction) { this.height = height; branchSettings = new Branch { depth = branchDepth, direction = direction }; }
void SpawnLeaves(VoxelStorage.Vector direction) { Spawn <Leaf>(point + direction); }
void SpawnBranch(VoxelStorage.Vector direction) { Spawn <Wood>(point + direction) .InitBranch(height: height, branchDepth: BranchDepth() + 1, direction: direction); }