1
This commit is contained in:
@@ -52,7 +52,7 @@ namespace BITKit.Entities
|
||||
{
|
||||
while (_onAddQueue.TryDequeue(out var entity))
|
||||
{
|
||||
if(_addingEntities.Remove(entity) is false)continue;
|
||||
if(_addingEntities.Remove(entity) is false || entity.CancellationToken.IsCancellationRequested)continue;
|
||||
OnAdd?.Invoke(entity);
|
||||
MakeCache(entity);
|
||||
}
|
||||
|
@@ -113,6 +113,19 @@ namespace BITKit
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static bool Contains<T>(this Span<T> span, T value)
|
||||
{
|
||||
foreach (var t in span)
|
||||
{
|
||||
if (Equals(t, value))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool Contains<T>(IEnumerable<T> a, IEnumerable<T> b)
|
||||
{
|
||||
foreach (var x in b)
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user