Esempio n. 1
0
    //If there is a score tracker, replace it with this one that is not deleted on scene change
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Awake()
 {
     scoretext      = FindObjectOfType <Text>();
     tracker        = FindObjectOfType <CreditTracker>();
     scoretext.text = "Credits: " + tracker.GetCreditBalance().ToString("D6");
 }