/// <summary> /// 开关切换 /// </summary> /// <param name="view"></param> /// <param name="status"></param> public void onSwitchChange(GameObject view, int status) { SoundUtil.playSoundClip(AudioButtonOnClickEnum.btn_sound_3); if (view == mMusicSelectionSwith.gameObject) { CommonConfigure.IsOpenBGM = (EnabledEnum)Enum.ToObject(typeof(EnabledEnum), status); if ((int)CommonConfigure.IsOpenBGM == 0) { SoundUtil.stopBGMClip(); } else { SoundUtil.playBGMClip(); } } else if (view == mSoundSelectionSwitch.gameObject) { CommonConfigure.IsOpenSound = (EnabledEnum)Enum.ToObject(typeof(EnabledEnum), status); } else if (view == mTimeUISelectionSwith.gameObject) { CommonConfigure.IsOpenTimeUI = (EnabledEnum)Enum.ToObject(typeof(EnabledEnum), status); } CommonConfigure.saveData(); CommonConfigure.refreshData(); CommonData.refreshData(); }
/// <summary> /// 增加退出按钮监听 /// </summary> public void addExitOnClick() { SoundUtil.playSoundClip(AudioButtonOnClickEnum.btn_sound_2); CommonConfigure.saveData(); mUIMasterControl.openUIByTypeAndCloseOther(UIEnum.MenuMainUI); }