IEnumerator GameSetup()
        {
            // Start UI
            gameSetupComplete = false;
            Instantiate(userInterface);
            // Pause Game
            GameManager.GamePause(true);
            // If not the hub start spawning Rooms;
            if (!preset)
            {
                SpawnFirstRoom();
            }
            else
            {
                roomsLoaded = true;
            }
            // Until the rooms are loaded wait
            while (!roomsLoaded)
            {
                yield return(null);
            }
            // questLoaded being true turns off the time stop

            Instantiate(questController);
            QuestController.PullQuest();

            if (!preset)
            {
                QuestSiteSetup();
            }
            questLoaded = true;

            while (!questLoaded)
            {
                yield return(null);
            }
            // Disable all rooms but the first one.
            bool first = false;

            foreach (RoomGeneration room in allRooms)
            {
                if (first)
                {
                    room.SetActive(false);
                }
                else
                {
                    first = true;
                }
            }
            if (FindObjectOfType <MinimapContoller> ())
            {
                FindObjectOfType <MinimapContoller> ().GetRoomPos();
            }
            // Game Unpause
            gameSetupComplete = true;
            GameManager.GamePause(false);
        }
示例#2
0
        // Use this for initialization
        void Start()
        {
            firstTimeSetup = false;
            questReady     = false;
            qController    = FindObjectOfType <QuestController> ();
            containingRoom = GetComponentInParent <RoomGeneration> ();
            setupDone      = false;
            droneUp        = false;

            qMarked = QuestController.activeEvents[Random.Range(1, QuestController.activeEvents.Count)];
        }
 // Use this for initialization
 void Start()
 {
     bc2D        = GetComponent <BoxCollider2D> ();
     qController = FindObjectOfType <QuestController>();
 }