修改bug

This commit is contained in:
shenjianxing 2025-01-22 12:58:27 +08:00
parent 614b3e4425
commit 605c4b1ada
2 changed files with 16 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public class Point3DItem : MonoBehaviour
}
rotSpeed = data.rotateSpeed;
gameObject.GetComponent<SpriteRenderer>().sortingOrder = data.order;
TypeEventSystem.Global.Register<OnPoint3DQuestionDestroy>(OnObjDestroy).UnRegisterWhenGameObjectDestroyed(gameObject);
TypeEventSystem.Global.Register<OnPoint3DQuestionDestroy>(OnObjDestroy);
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
}
@ -49,8 +49,16 @@ public class Point3DItem : MonoBehaviour
private void OnObjDestroy(OnPoint3DQuestionDestroy destroy)
{
if (gameObject != null)
{
GameObject.Destroy(gameObject);
}
}
private void OnDestroy()
{
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
GameObject.Destroy(gameObject);
TypeEventSystem.Global.UnRegister<OnPoint3DQuestionDestroy>(OnObjDestroy);
}
private void OnMouseUpAsButton()

View File

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