Merge branch 'master' into LouDi_Quan

This commit is contained in:
shenjianxing 2025-01-16 17:55:47 +08:00
commit 145d7d7872

View File

@ -27,6 +27,8 @@ namespace QFramework
string frame;
string speed;
string deviceName;
float totalTime;
public static AnimationAction Allocate(string path, Dictionary<string, string> datas, System.Action OnFinished = null)
{
var retNode = mPool.Allocate();
@ -95,16 +97,13 @@ namespace QFramework
else
{
anim[animName].speed = curSpeed;
anim.Play(animName);
if (anim[animName].wrapMode == WrapMode.Loop)
{
this.Finish();
}
}
totalTime = Math.Abs(anim[animName].length / curSpeed);
}
}
catch (Exception)
@ -123,7 +122,8 @@ namespace QFramework
public void OnExecute(float dt)
{
if (anim != null && anim.isPlaying == false)
totalTime -= Time.deltaTime;
if (anim != null && (anim.isPlaying == false || totalTime <= 0))
{
this.Finish();
}