예제 #1
0
    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);
            }
        }
    }
예제 #2
0
파일: Wood.cs 프로젝트: bfops/Chemison
 public void InitBranch(int height, int branchDepth, VoxelStorage.Vector direction)
 {
     this.height    = height;
     branchSettings = new Branch {
         depth = branchDepth, direction = direction
     };
 }
예제 #3
0
파일: Wood.cs 프로젝트: bfops/Chemison
 void SpawnLeaves(VoxelStorage.Vector direction)
 {
     Spawn <Leaf>(point + direction);
 }
예제 #4
0
파일: Wood.cs 프로젝트: bfops/Chemison
 void SpawnBranch(VoxelStorage.Vector direction)
 {
     Spawn <Wood>(point + direction)
     .InitBranch(height: height, branchDepth: BranchDepth() + 1, direction: direction);
 }