示例#1
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     bgMusic = GameObject.Find("BackgroundMusic");
     bgMusic.GetComponent <AudioSource> ().Play();
     music = GameObject.FindObjectOfType <DontDestroyMusic>();
     UpdateIcon();
 }
示例#2
0
 void Awake()
 {
     if (instanceRef == null)
     {
         instanceRef = this;
         DontDestroyOnLoad(transform.gameObject);
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
示例#4
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     //dont destroy the music across scenes
     DontDestroyOnLoad(transform.gameObject);
 }
示例#5
0
 void Awake()
 {
     if (volumeControl != null && volumeControl != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         volumeControl = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
示例#6
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
     GetComponent <AudioSource>().ignoreListenerPause = true;
     PauseSFX();
 }
示例#7
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
示例#8
0
 void Start()
 {
     music = GameObject.FindObjectOfType <DontDestroyMusic>();
     changeText();
 }