mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
1、修复了MongoDB在2.18.0以后需要自定义注册ObjectSerializer的问题。 2、Addressable的AddAddressable接口增加isLock参数、用来决定是否需要添加携程锁。 3、修复了APackInfo因为网络多线程的原因导致线程安全的问题。
1、修复了MongoDB在2.18.0以后需要自定义注册ObjectSerializer的问题。 2、Addressable的AddAddressable接口增加isLock参数、用来决定是否需要添加携程锁。 3、修复了APackInfo因为网络多线程的原因导致线程安全的问题。
This commit is contained in:
@@ -13,6 +13,7 @@ using Newtonsoft.Json;
|
||||
|
||||
// ReSharper disable SuspiciousTypeConversion.Global
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
@@ -401,11 +402,54 @@ namespace TEngine
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#if TENGINE_NET
|
||||
#region ForEach
|
||||
public IEnumerable<Entity> ForEachSingleCollection
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (var (_, treeEntity) in _tree)
|
||||
{
|
||||
if (treeEntity is not ISupportedSingleCollection)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
yield return treeEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
public IEnumerable<Entity> ForEachTransfer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_tree != null)
|
||||
{
|
||||
foreach (var (_, treeEntity) in _tree)
|
||||
{
|
||||
if (treeEntity is ISupportedSingleCollection || treeEntity is ISupportedTransfer)
|
||||
{
|
||||
yield return treeEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_multiDb != null)
|
||||
{
|
||||
foreach (var treeEntity in _multiDb)
|
||||
{
|
||||
if (treeEntity is not ISupportedTransfer)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
yield return treeEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endif
|
||||
|
||||
#region GetComponent
|
||||
|
||||
public DictionaryPool<Type, Entity> GetTree => _tree;
|
||||
|
||||
public T GetComponent<T>() where T : Entity, new()
|
||||
{
|
||||
return GetComponent(typeof(T)) as T;
|
||||
|
Reference in New Issue
Block a user