示例#1
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
	// Use this for initialization
	void Awake () {

        if (difficultyTrack != null)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            difficultyTrack = this;
            DontDestroyOnLoad(this.gameObject);
            //default to normal
            difficulty = 1;
        }
        
	}