Example #1
0
 private void Awake()
 {
     if (instance)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     DontDestroyOnLoad(gameObject);
 }