Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         music.Play();
         DontDestroyOnLoad(gameObject);
     }
     else
         Destroy(gameObject);
 }
Exemplo n.º 2
0
 void Awake()
 {
     if (instant != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instant = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         music.Play();
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }