示例#1
0
 protected override void Awake()
 {
     base.Awake();
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(this);
     }
 }
    // Use this for initialization
    protected void Awake () {
        s_instance = this;
        DontDestroyOnLoad(this);
        m_source.clip = m_titleTheme;
        m_source.Play();
	}
 // Use this for initialization
 void Start()
 {
     musicPlayer            = FindObjectOfType <PersistentMusicPlayer>();
     volumeSlider.value     = PlayerPrefsManager.GetMasterVolume();
     difficultySlider.value = PlayerPrefsManager.GetDifficult();
 }