void Awake()
	{
		if(instance == null)
		{
			GameObject.DontDestroyOnLoad(gameObject);
			instance = this;
		}
		else {
			Destroy (gameObject);
		}
	}
Exemple #2
0
 void Awake()
 {
     if (instance == null)
     {
         GameObject.DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }