动画停止
This commit is contained in:
parent
1b22d00ff5
commit
b5a79921a9
@ -1,8 +1,11 @@
|
||||
using DG.Tweening;
|
||||
using DG.Tweening.Core;
|
||||
using DG.Tweening.Plugins.Options;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using static OperationController;
|
||||
|
||||
namespace QFramework
|
||||
{
|
||||
@ -45,7 +48,7 @@ namespace QFramework
|
||||
}
|
||||
public ulong ActionID { get; set; }
|
||||
public ActionStatus Status { get; set; }
|
||||
|
||||
TweenerCore<float, float, FloatOptions> animDot;
|
||||
public void OnStart()
|
||||
{
|
||||
GameObject obj = null;
|
||||
@ -89,7 +92,8 @@ namespace QFramework
|
||||
{
|
||||
anim.Play(animName);
|
||||
anim[animName].normalizedTime = 1;
|
||||
DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed)).onComplete = () =>
|
||||
animDot = DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed));
|
||||
animDot.onComplete = () =>
|
||||
{
|
||||
anim.Stop();
|
||||
};
|
||||
@ -119,6 +123,7 @@ namespace QFramework
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnExecute(float dt)
|
||||
{
|
||||
totalTime -= Time.deltaTime;
|
||||
@ -144,6 +149,8 @@ namespace QFramework
|
||||
{
|
||||
if (!Deinited)
|
||||
{
|
||||
animDot?.Kill();
|
||||
anim?.Stop();
|
||||
OnFinished = null;
|
||||
Deinited = true;
|
||||
mPool.Recycle(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user