コード例 #1
0
    public void MainHall(string entrance)
    {
        if (mainRoom < 6)
        {
            if (mainRoom > 2 && !mainHallDirections.ContainsValue("mainGate"))
            {
                mainHallDirections.Add(entrance, "mainGate");
                clickManager.SetNextNode("mainGate");
            }
            else
            {
                int selection = mainRoomChoices[UnityEngine.Random.Range(0, mainRoomChoices.Count)];
                mainRoomChoices.Remove(selection);
                switch (selection)
                {
                case 0:
                    string randomNode = shortRooms[UnityEngine.Random.Range(0, shortRooms.Count)];
                    shortRooms.Remove(randomNode);
                    mainHallDirections.Add(entrance, randomNode);
                    clickManager.SetNextNode(randomNode);
                    break;

                case 1:
                    string randomNode1 = randomRooms[UnityEngine.Random.Range(0, randomRooms.Count)];
                    clickManager.SetNextNode(randomNode1);
                    mainHallDirections.Add(entrance, randomNode1);
                    break;

                case 2:
                    string randomNode2 = longRooms[UnityEngine.Random.Range(0, longRooms.Count)];
                    clickManager.SetNextNode(randomNode2);
                    longRooms.Remove(randomNode2);
                    mainHallDirections.Add(entrance, randomNode2);
                    break;

                case 3:
                    clickManager.SetNextNode("mainGate");
                    mainHallDirections.Add(entrance, "mainGate");
                    break;

                case 4:
                    string randomNode3 = shortRooms[UnityEngine.Random.Range(0, shortRooms.Count)];
                    clickManager.SetNextNode(randomNode3);
                    shortRooms.Remove(randomNode3);
                    mainHallDirections.Add(entrance, randomNode3);
                    break;

                case 5:
                    string randomNode4 = randomRooms[UnityEngine.Random.Range(0, randomRooms.Count)];
                    clickManager.SetNextNode(randomNode4);
                    mainHallDirections.Add(entrance, randomNode4);
                    break;
                }
            }
            mainRoom++;
        }
        else
        {
            string randomNode1 = randomRooms[UnityEngine.Random.Range(0, randomRooms.Count)];
            clickManager.SetNextNode(randomNode1);
        }
    }