Beispiel #1
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         //DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #3
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     print("instance " + instance);
     if (instance != null)
     {
         Destroy(gameObject);
         print("destroy");
     }
     else
     {
         instance = this;
     }
 }
Beispiel #4
0
 private void Awake()
 {
     if (BgMusic.bgMusic == null)
     {
         BgMusic.bgMusic = this;
     }
     else
     {
         if (BgMusic.bgMusic != this)
         {
             Destroy(this.gameObject);
         }
     }
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #5
0
    IEnumerator mainStep()
    {
        yield return(new WaitUntil(() => bStart == true));

        while (bStart)
        {
            yield return(new WaitForSeconds(1));

            MyNotifications.CallNotification("Listen Background Music", 5);
            yield return(new WaitForSeconds(1));

            BgMusic.Play();
            yield return(new WaitForSeconds(5));


            MyNotifications.CallNotification("Listen Music Note", 20);
            string[] requirtNote = { "", "", "" };
            requirtNote = muiscNote[0].Split(',');
            PlayRequire(requirtNote);
            yield return(new WaitForSeconds(20));

            MyNotifications.CallNotification("Goodbye World!", 3);
        }
    }