コード例 #1
0
    void GenerateMap()
    {
        map = new int[width, height, depth];
        RandomFillMap();

        CubeBoxGenerator cubeBoxGen = GetComponent <CubeBoxGenerator>();

        cubeBoxGen.GenerateCubeBox(map);
    }
コード例 #2
0
    private IEnumerator UpdateMap()
    {
        while (true)
        {
            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    for (int z = 0; z < depth; z++)
                    {
                        map[x, y, z] = lifeEngine.CalcCellInLukesBox(x, y, z);
                    }
                }
            }
            yield return(new WaitForSeconds(updateTime));

            CubeBoxGenerator cubeBoxGen = GetComponent <CubeBoxGenerator>();
            cubeBoxGen.GenerateCubeBox(map);
        }
    }