Merge remote-tracking branch 'origin/master' into LouDi_Pig

This commit is contained in:
李浩 2024-12-31 16:19:30 +08:00
commit 368e27f71f
4 changed files with 53 additions and 44 deletions

View File

@ -45,6 +45,8 @@ namespace QFramework
{ {
GameObject obj = Utility.FindObj(path); GameObject obj = Utility.FindObj(path);
if (obj != null) if (obj != null)
{
try
{ {
anim = obj.GetComponent<Animation>(); anim = obj.GetComponent<Animation>();
@ -68,8 +70,15 @@ namespace QFramework
anim.Play(animName); anim.Play(animName);
} }
} }
catch (Exception)
{
Debug.LogError($"{path} 播放动画 {animName} 出错");
}
}
else else
{ {
Debug.LogError("未找到路径:" + path);
this.Finish(); this.Finish();
} }
} }

View File

@ -35,7 +35,7 @@ namespace QFramework
{ {
UIPointQuestionData data = new UIPointQuestionData(); UIPointQuestionData data = new UIPointQuestionData();
data.paths = paths; data.paths = paths;
UIKit.OpenPanelAsync<UIPointQuestion>(uiData: data).ToAction().StartGlobal(() => this.Finish()); UIKit.OpenPanelAsync<UIPointQuestion>(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish());
} }
public void OnExecute(float dt) public void OnExecute(float dt)

View File

@ -16,7 +16,7 @@ namespace QFramework.Example
public Vector3 normalRot; public Vector3 normalRot;
public float nearTime; public float nearTime;
public float normalTime; public float normalTime;
public bool isNear = false; public bool isNear;
} }
public partial class UICameraSwitch : UIPanel public partial class UICameraSwitch : UIPanel
@ -60,30 +60,28 @@ namespace QFramework.Example
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData(); mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
//if (mData.isNear)
//{
if (mData.isNear) // if (Near.isOn == false)
{ // {
if (Near.isOn == false) // Near.isOn = true;
{ // }
Near.isOn = true; // else
} // {
else // SetNear();
{ // }
SetNear(); //}
} //else
} //{
else // if (Far.isOn == false)
{ // {
if (Far.isOn == false) // Far.isOn = true;
{ // }
Far.isOn = true; // else
} // {
else // SetNormal();
{ // }
SetNormal(); //}
}
}
} }
protected override void OnShow() protected override void OnShow()

View File

@ -28,6 +28,8 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null) protected override void OnOpen(IUIData uiData = null)
{ {
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData(); mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
Content.RemoveAllChildren();
var paths = mData.paths.Split(','); var paths = mData.paths.Split(',');
for (int i = 0; i < paths.Length; i++) for (int i = 0; i < paths.Length; i++)
{ {
@ -60,11 +62,11 @@ namespace QFramework.Example
protected override void OnHide() protected override void OnHide()
{ {
pointMap.Clear();
} }
protected override void OnClose() protected override void OnClose()
{ {
pointMap.Clear();
} }
} }
} }