Beispiel #1
0
 /// <summary>
 /// AUdioSourceを生成する
 /// </summary>
 static void AudioSourceGenerate()
 {
     if (m_BgmAud)
     {
         return;
     }
     m_BgmAud      = DontDestroyObject.Generate("BGM").AddComponent <AudioSource>();
     m_BgmAud.loop = true;
     m_BgmAud.outputAudioMixerGroup = SoundManager.GetInstance().GetAudioMixerGroup("BGM");
 }
Beispiel #2
0
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
Beispiel #3
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(this.gameObject);
         return;
     }
     Instance = this;
     DontDestroyOnLoad(this.gameObject);
 }
 void Awake()
 {
     if (instance != null && instance != this) {
      Destroy(this.gameObject);
      return;
      } else {
      instance = this;
      }
      DontDestroyOnLoad(this.gameObject);
 }
Beispiel #5
0
 private void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #6
0
    void Start()
    {
        DontDestroyOnLoad(this.gameObject);

        if (instance == null)
        {
            DontDestroyOnLoad(this.gameObject);
            instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }