增加错误日志
This commit is contained in:
parent
c3f7e8949e
commit
bb57c527b7
@ -46,30 +46,39 @@ namespace QFramework
|
|||||||
GameObject obj = Utility.FindObj(path);
|
GameObject obj = Utility.FindObj(path);
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
anim = obj.GetComponent<Animation>();
|
try
|
||||||
|
{
|
||||||
|
anim = obj.GetComponent<Animation>();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(frame) == false && frame != "-1")
|
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)
|
|
||||||
{
|
{
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
|
Debug.LogError("未找到路径:" + path);
|
||||||
this.Finish();
|
this.Finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user