示例#1
0
    void Start()
    {
        m_currentMenu = m_defaultMenu;
        if (m_showMenus)
        {
            ShowCurrentMenu();
        }
        m_navigationWaitTime = m_navigationDelay;

        m_menuAudio = GetComponentInChildren <MenuAudioManager>();
    }
示例#2
0
 private void Awake()
 {
     if (!menuAudioManager)
     {
         menuAudioManager = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
示例#3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        //DontDestroyOnLoad(gameObject);
    }
示例#4
0
    void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            _instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
示例#5
0
    // Use this for initialization
    void Awake()
    {
        // Keep the game object Active between scenes
        if (Instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }

        foreach (var Audio in MenuSounds)
        {
            Audio.source      = gameObject.AddComponent <AudioSource>();
            Audio.source.clip = Audio.clip;
            Audio.source.outputAudioMixerGroup = Group;
        }
        Stop();
    }
示例#6
0
 private void Awake()
 {
     Instance = this;
 }