Exemplo n.º 1
0
    ///////////////////////////Grid Cubes///////////////////////////

    // Record the grid cubes (start and end of game)
    public void RecordGridCubes(GameObject[,] gridCubes, bool start)
    {
        // Loop through all the cubes
        foreach (GameObject go in gridCubes)
        {
            // Add cube to the cube positions dictionary
            CubeData cubeData = go.GetComponent <CubeData>();
            Vector3  cubePos  = cubeData.GetCubeCoord();

            // Start of the game
            if (start)
            {
                cubePositionsStart.Add(new CubeStat {
                    position = cubePos, type = cubeData.GetCubeType()
                });
            }

            // End of the game
            else
            {
                cubePositionsEnd.Add(new CubeStat {
                    position = cubePos, type = cubeData.GetCubeType()
                });
            }
        }
    }