/// <summary> /// 初始化设置界面 /// </summary> /// <param name="settings">Settings.</param> /// <param name="volumeChangeCallBack">Volume change call back.</param> public void SetUpSettingView(GameSettings settings, CallBackWithFloat volumeChangeCallBack) { float volume = settings.systemVolume; if (volume < 0) { volume = 0; } else if (volume > 1f) { volume = 1f; } volumeControl.value = (int)(volume * 100); UpdatePronounceControl(settings.isAutoPronounce); UpdateDifficultySelectedIcons(); volumeControl.InitHLHSlider(volumeChangeCallBack); // 只有ios上有恢复内购和隐私政策按钮 #if UNITY_IOS restoreItemsButton.gameObject.SetActive(true); privacyButton.gameObject.SetActive(true); #elif UNITY_ANDROID restoreItemsButton.gameObject.SetActive(false); privacyButton.gameObject.SetActive(false); #elif UNITY_EDITOR restoreItemsButton.gameObject.SetActive(false); privacyButton.gameObject.SetActive(false); #endif GetComponent <Canvas> ().enabled = true; }
public void InitHLHSlider(CallBackWithFloat valueChangeCallBack) { this.valueChangeCallBack = valueChangeCallBack; }