public void InitPanel() { _MusicSoundComponent = Game.Scene.GetComponent <MusicSoundComponent>(); mCloseBtn.Add(Hide); mOutBtn.Add(OutBtnEvent); mRuleBtn.Add(RuleBtnEvent); mMusicSlider.Add(MusiceSliderEvent); mSoundSlider.Add(SoundSliderEvent); }
public void Awake() { Ins = this; mMusicAudioSource = GameObject.Find("Global").AddComponent <AudioSource>(); mSoundAudioSource = GameObject.Find("Global").AddComponent <AudioSource>(); mMusicAudioSource.loop = true; mSoundAudioSource.loop = false; ButtonClickSound.RegisterPlayButtonSound();//注册按钮点击 播放事件 MusicVolume = PlayerPrefs.GetFloat(MusicVolumePrefsName, 1f); SoundVolume = PlayerPrefs.GetFloat(SoundVolumePrefsName, 1f); }