Пример #1
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     masterTracker          = GetComponent <MasterTracker>();
     smallTankPointsWorth   = masterTracker.SmallTankPointsWorth;
     fastTankPointsWorth    = masterTracker.FastTankPointsWorth;
     bigTankPointsWorth     = masterTracker.BigTankPointsWorth;
     armoredTankPointsWorth = masterTracker.armoredTankPointsWorth;
     stageText.text         = "STAGE " + MasterTracker.stageNumber;
     playerScoreText.text   = MasterTracker.playerScore.ToString();
     hiScoreText.text       = highscore.ToString();
     StartCoroutine(UpdateTankPoints());
 }