This commit is contained in:
CortexCore
2025-08-03 02:28:50 +08:00
parent ecae0f809c
commit c3f0a8e840
8 changed files with 114 additions and 6 deletions

View File

@@ -5,6 +5,9 @@ using System.Threading;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using Unity.Mathematics;
#if UNITY_5_3_OR_NEWER
using UnityEngine;
#endif
namespace BITKit.Tween
{
@@ -68,7 +71,13 @@ namespace BITKit.Tween
//BIT4Log.Log<TweenSequence>($"已创建Tween,from:[{from}]to:[{to}]duration:[{duration}]delta:[{delta}]");
while (t < 1 && cancellationToken.IsCancellationRequested is false)
{
t = math.clamp(t + delta*BITApp.Time.DeltaTime, 0, 1);
var value = t + delta * BITApp.Time.DeltaTime;
#if UNITY_5_3_OR_NEWER
value = t+ delta * Time.deltaTime;
#endif
t = math.clamp(value, 0, 1);
var next = func(from, to, t);
#if UNITY_5_3_OR_NEWER
await UniTask.NextFrame(cancellationToken);