Exemplo n.º 1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            if (Popup == null)
            {
                Popup = GameObject.Find("PopUp");
            }
            if (Followers == null)
            {
                Followers = GameObject.Find("GainedFollowers");
            }
            if (GainedChurch == null)
            {
                GainedChurch = GameObject.Find("GainedChurch");
            }
            if (GainedPolitics == null)
            {
                GainedPolitics = GameObject.Find("GainedPolitics");
            }

            if (GainedArmy == null)
            {
                GainedArmy = GameObject.Find("GainedArmy");
            }
            if (GainedCult == null)
            {
                GainedCult = GameObject.Find("GainedCult");
            }
            if (!instance.saved)
            {
                instance.DontDestroyOnLoad();
            }
            //    if (!shouldDisplay)
        }
        else
        {
            Destroy(this.gameObject);
        }
    }