This commit is contained in:
shenjianxing 2025-01-22 12:59:17 +08:00
commit 9486baa83e
2 changed files with 14 additions and 1 deletions

View File

@ -49,9 +49,16 @@ public class Point3DItem : MonoBehaviour
private void OnObjDestroy(OnPoint3DQuestionDestroy destroy) private void OnObjDestroy(OnPoint3DQuestionDestroy destroy)
{ {
if (gameObject != null)
{
GameObject.Destroy(gameObject);
}
}
private void OnDestroy()
{
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged); TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
TypeEventSystem.Global.UnRegister<OnPoint3DQuestionDestroy>(OnObjDestroy); TypeEventSystem.Global.UnRegister<OnPoint3DQuestionDestroy>(OnObjDestroy);
GameObject.Destroy(gameObject);
} }
private void OnMouseUpAsButton() private void OnMouseUpAsButton()

View File

@ -15,9 +15,11 @@ namespace QFramework.Example
mData = uiData as UISettingData ?? new UISettingData(); mData = uiData as UISettingData ?? new UISettingData();
AudioKit.Settings.MusicVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this); AudioKit.Settings.MusicVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
AudioKit.Settings.VoiceVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
VoiceSlider.onValueChanged.AddListener(volume => VoiceSlider.onValueChanged.AddListener(volume =>
{ {
AudioKit.Settings.MusicVolume.Value = volume; AudioKit.Settings.MusicVolume.Value = volume;
AudioKit.Settings.VoiceVolume.Value = volume;
}); });
Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => MouseSlider.value = v).UnRegisterWhenGameObjectDestroyed(this); Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => MouseSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
@ -48,6 +50,10 @@ namespace QFramework.Example
{ {
AudioKit.Settings.MusicVolume.Value += value; AudioKit.Settings.MusicVolume.Value += value;
} }
if (AudioKit.Settings.VoiceVolume.Value > 0.1f && AudioKit.Settings.VoiceVolume.Value < 1f)
{
AudioKit.Settings.VoiceVolume.Value += value;
}
} }