diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index f2cc26a3..5a9691af 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -46,30 +46,39 @@ namespace QFramework GameObject obj = Utility.FindObj(path); if (obj != null) { - anim = obj.GetComponent(); + try + { + anim = obj.GetComponent(); - if (string.IsNullOrEmpty(frame) == false && frame != "-1") - { - int curFrame = 0; - int.TryParse(frame, out curFrame); - 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) + if (string.IsNullOrEmpty(frame) == false && frame != "-1") { - float.TryParse(speed, out curSpeed); + int curFrame = 0; + int.TryParse(frame, out curFrame); + 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[animName].speed = curSpeed; + anim.Play(animName); } - anim[animName].speed = curSpeed; - anim.Play(animName); } + catch (Exception) + { + Debug.LogError($"{path} 播放动画 {animName} 出错"); + } + } else { + Debug.LogError("未找到路径:" + path); this.Finish(); } } diff --git a/Assets/Scripts/Actions/PointQuestionAction.cs b/Assets/Scripts/Actions/PointQuestionAction.cs index d9b4210d..ebad4900 100644 --- a/Assets/Scripts/Actions/PointQuestionAction.cs +++ b/Assets/Scripts/Actions/PointQuestionAction.cs @@ -35,7 +35,7 @@ namespace QFramework { UIPointQuestionData data = new UIPointQuestionData(); data.paths = paths; - UIKit.OpenPanelAsync(uiData: data).ToAction().StartGlobal(() => this.Finish()); + UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish()); } public void OnExecute(float dt) diff --git a/Assets/Scripts/UI/UICameraSwitch.cs b/Assets/Scripts/UI/UICameraSwitch.cs index 7890ac3b..532f5fe4 100644 --- a/Assets/Scripts/UI/UICameraSwitch.cs +++ b/Assets/Scripts/UI/UICameraSwitch.cs @@ -16,7 +16,7 @@ namespace QFramework.Example public Vector3 normalRot; public float nearTime; public float normalTime; - public bool isNear = false; + public bool isNear; } public partial class UICameraSwitch : UIPanel @@ -60,30 +60,28 @@ namespace QFramework.Example mData = uiData as UICameraSwitchData ?? new UICameraSwitchData(); - - - if (mData.isNear) - { - if (Near.isOn == false) - { - Near.isOn = true; - } - else - { - SetNear(); - } - } - else - { - if (Far.isOn == false) - { - Far.isOn = true; - } - else - { - SetNormal(); - } - } + //if (mData.isNear) + //{ + // if (Near.isOn == false) + // { + // Near.isOn = true; + // } + // else + // { + // SetNear(); + // } + //} + //else + //{ + // if (Far.isOn == false) + // { + // Far.isOn = true; + // } + // else + // { + // SetNormal(); + // } + //} } protected override void OnShow() diff --git a/Assets/Scripts/UI/UIPointQuestion.cs b/Assets/Scripts/UI/UIPointQuestion.cs index 49c43b95..f9cb7d81 100644 --- a/Assets/Scripts/UI/UIPointQuestion.cs +++ b/Assets/Scripts/UI/UIPointQuestion.cs @@ -28,6 +28,8 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { mData = uiData as UIPointQuestionData ?? new UIPointQuestionData(); + + Content.RemoveAllChildren(); var paths = mData.paths.Split(','); for (int i = 0; i < paths.Length; i++) { @@ -60,11 +62,11 @@ namespace QFramework.Example protected override void OnHide() { + pointMap.Clear(); } protected override void OnClose() { - pointMap.Clear(); } } }