From 6228329b2a4b5c095dea2abf4da99281a100d461 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 22 Jan 2025 10:59:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=89=A9=E4=BD=93=E6=9C=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=97=B6=E7=9B=B4=E6=8E=A5finish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/AnimationAction.cs | 76 ++++++++++++----------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index e3c9f60c..dd214004 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -65,55 +65,61 @@ namespace QFramework if (obj.activeSelf == false) { Debug.LogError(obj.name + "ǰ״̬"); + this.Finish(); } - try + else { - anim = obj.GetComponent(); - - if (string.IsNullOrEmpty(frame) == false && frame != "-1") + try { - int curFrame = 0; - int.TryParse(frame, out curFrame); - anim.clip = anim[animName].clip; - anim[animName].time = curFrame / anim.clip.frameRate; - anim[animName].speed = 0; - anim.Play(animName); - this.Finish(); - } - else - { - float curSpeed = 1; - if (string.IsNullOrEmpty(speed) == false) - { - float.TryParse(speed, out curSpeed); - } + anim = obj.GetComponent(); - if (curSpeed < 0) + if (string.IsNullOrEmpty(frame) == false && frame != "-1") { + int curFrame = 0; + int.TryParse(frame, out curFrame); + anim.clip = anim[animName].clip; + anim[animName].time = curFrame / anim.clip.frameRate; + anim[animName].speed = 0; anim.Play(animName); - anim[animName].normalizedTime = 1; - animDot = DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed)); - animDot.onComplete = () => - { - anim.Stop(); - }; + this.Finish(); } else { - anim[animName].speed = curSpeed; - anim.Play(animName); - if (anim[animName].wrapMode == WrapMode.Loop) + float curSpeed = 1; + if (string.IsNullOrEmpty(speed) == false) { - this.Finish(); + float.TryParse(speed, out curSpeed); } + + if (curSpeed < 0) + { + anim.Play(animName); + anim[animName].normalizedTime = 1; + animDot = DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed)); + animDot.onComplete = () => + { + anim.Stop(); + }; + } + else + { + anim[animName].speed = curSpeed; + anim.Play(animName); + if (anim[animName].wrapMode == WrapMode.Loop) + { + this.Finish(); + } + } + totalTime = Math.Abs(anim[animName].length / curSpeed); } - totalTime = Math.Abs(anim[animName].length / curSpeed); + } + catch (Exception) + { + anim = obj.GetComponent(); + Debug.LogError($"{path} Ŷ {animName} "); } } - catch (Exception) - { - Debug.LogError($"{path} Ŷ {animName} "); - } + } else From 614b3e442504e2c834bdf281fbd073bbf7a24953 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 22 Jan 2025 11:03:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8A=A5=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/AnimationAction.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index dd214004..fd96f1ee 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -157,7 +157,10 @@ namespace QFramework { if (obj != null) { - anim?.Stop(); + if (anim!=null) + { + anim.Stop(); + } } animDot?.Kill(); OnFinished = null; From 605c4b1adae19e2a0bdc50152dd2f56dd52fe217 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 22 Jan 2025 12:58:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Item/Point3DItem.cs | 12 ++++++++++-- Assets/Scripts/UI/UISetting.cs | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Item/Point3DItem.cs b/Assets/Scripts/Item/Point3DItem.cs index d8ca8442..8acfd894 100644 --- a/Assets/Scripts/Item/Point3DItem.cs +++ b/Assets/Scripts/Item/Point3DItem.cs @@ -37,7 +37,7 @@ public class Point3DItem : MonoBehaviour } rotSpeed = data.rotateSpeed; gameObject.GetComponent().sortingOrder = data.order; - TypeEventSystem.Global.Register(OnObjDestroy).UnRegisterWhenGameObjectDestroyed(gameObject); + TypeEventSystem.Global.Register(OnObjDestroy); TypeEventSystem.Global.Register(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(OnStepChanged); - GameObject.Destroy(gameObject); + TypeEventSystem.Global.UnRegister(OnObjDestroy); } private void OnMouseUpAsButton() diff --git a/Assets/Scripts/UI/UISetting.cs b/Assets/Scripts/UI/UISetting.cs index 1e4199b8..c64c3346 100644 --- a/Assets/Scripts/UI/UISetting.cs +++ b/Assets/Scripts/UI/UISetting.cs @@ -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; + } } From d425a98349b506c29bc238a4284f86693ede9dbb Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Wed, 22 Jan 2025 18:21:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Controller/ScoreController.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Assets/Scripts/Controller/ScoreController.cs b/Assets/Scripts/Controller/ScoreController.cs index 460ded4d..65f7f5c0 100644 --- a/Assets/Scripts/Controller/ScoreController.cs +++ b/Assets/Scripts/Controller/ScoreController.cs @@ -96,9 +96,6 @@ public class ScoreController : MonoSingleton private void OnQuit(OnModuleQuit quit) { - var data = moduleDict[Global.Instance.curModule.ModuleName]; - var scoreDict = data.scoreDict; - scoreDict.Clear(); TypeEventSystem.Global.UnRegister(OnStart); TypeEventSystem.Global.UnRegister(OnQuit); }