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

@ -46,30 +46,39 @@ namespace QFramework
GameObject obj = Utility.FindObj(path);
if (obj != null)
{
anim = obj.GetComponent<Animation>();
try
{
anim = obj.GetComponent<Animation>();
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();
}
}

View File

@ -35,7 +35,7 @@ namespace QFramework
{
UIPointQuestionData data = new UIPointQuestionData();
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)

View File

@ -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()

View File

@ -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();
}
}
}