Exemple #1
0
        void SpawnGoal(Maze maze)
        {
            PressurePlate prefab = Game.Prefabs.PressurePlate;
            MazeNode      node   = maze.RandomNode();

            Vector3 position = node.WorldPos + Vector3.down * node.Size.y * 0.5f;

            Game.Goal = MonoBehaviour.Instantiate(prefab, position, prefab.transform.rotation);

            node.OpenRandomSide(true);

            foreach (MazeNode neighbour in maze.GetNeighbours(node))
            {
                neighbour.OpenRandomSide(true);
            }

            Game.Grid.RecreateGrid();
        }