示例#1
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }


        //
        bolas = new List <int>();
        bolas.Add(0);



        if (!PlayerPrefs.HasKey("Bola0"))
        {
            PlayerPrefs.SetInt("Bola0", bolas[0]);
            PlayerPrefs.SetInt("list_Count", 1);           //novo
            print("salvo");
        }

        for (int i = 1; i < PlayerPrefs.GetInt("list_Count"); i++)
        {
            bolas.Add(PlayerPrefs.GetInt("Bola" + i));
        }

        //loja
        if (OndeEstou.instance.fase == 2)                                            //
        {
            menuIMG = GameObject.FindWithTag("imgBolasLoja").GetComponent <Image>(); //

            //moedasUI = GameObject.FindWithTag("coinUI").GetComponent<Text>();

            desafio1T = GameObject.FindWithTag("togg1").GetComponent <Toggle>();
            desafio2T = GameObject.FindWithTag("togg2").GetComponent <Toggle>();
            desafio3T = GameObject.FindWithTag("togg3").GetComponent <Toggle>();


            desafio1 = GameObject.FindWithTag("d1").GetComponent <Text>();
            desafio2 = GameObject.FindWithTag("d2").GetComponent <Text>();
            desafio3 = GameObject.FindWithTag("d3").GetComponent <Text>();
        }
        ///



        SceneManager.sceneLoaded += Carrega;
    }
示例#2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         //DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     SceneManager.sceneLoaded += Carrega;
 }
示例#3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        SceneManager.sceneLoaded += Carrega;

        DadosParaCarregamento();
    }
示例#4
0
    void Awake()
    {
        desafioT = GameObject.FindWithTag("togg").GetComponent <Toggle>();

        desafio = desafioT.GetComponentInChildren <Text>();

        //desafio = GameObject.FindWithTag("desf").GetComponent<Text>();



        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
        SceneManager.sceneLoaded += Carrega;
    }