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