public void ReturnToMainMenu()
        {
            GameObject controllerGO = GameObject.FindWithTag("GameController");

            if (controllerGO != null)
            {
                LoadingScreenScript loadingScript = controllerGO.GetComponent <LoadingScreenScript>();
                loadingScript.ReturnToMainMenu();
            }
        }
Пример #2
0
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
        public void LoadLocation(string newLocation)
        {
            GameObject controllerGO = GameObject.FindWithTag("GameController");

            if (controllerGO != null)
            {
                if (SceneManager.GetActiveScene().name == newLocation)
                {
                    gameObject.SetActive(true);
                    phoneMenuGO.SetActive(true);
                    return;
                }
                LoadingScreenScript loadingScript = controllerGO.GetComponent <LoadingScreenScript>();
                loadingScript.LoadNewArea(newLocation);
            }
        }
Пример #4
0
    // Leave scene via button
    public void TryLeaving()
    {
        Scheduler schedule = GetComponent <Scheduler>();

        schedule.ResetLocation();

        if (fullness <= capacity)
        {
            AIConversant conversant = GetComponent <AIConversant>();
            conversant.StartDialogue("Out of Food");
        }
        else
        {
            LoadingScreenScript loadingScreenScript = GameObject.FindWithTag("GameController").GetComponent <LoadingScreenScript>();
            loadingScreenScript.LoadNewArea("Home");
        }
    }