add static EcsAspect.GetMask

This commit is contained in:
DCFApixels 2025-06-03 23:13:28 +08:00
parent a016763824
commit 68118dc581

View File

@ -87,6 +87,10 @@ namespace DCFApixels.DragonECS
{
get { return EcsAspect.CurrentBuilder.Opt; }
}
public static EcsMask.Builder GetMask()
{
return EcsAspect.CurrentBuilder.GetMask();
}
}
public abstract class EcsAspect : IEcsAspect, ITemplateNode, IComponentMask
{
@ -130,6 +134,10 @@ namespace DCFApixels.DragonECS
{
get { return B.Singleton; }
}
protected static EcsMask.Builder GetMask()
{
return B.GetMask();
}
#endregion
//Инициализация аспектов проходит в синхронизированном состоянии, поэтому использование _staticMaskCache потоко безопасно.
@ -277,6 +285,10 @@ namespace DCFApixels.DragonECS
#endregion
#region Include/Exclude/Optional/Combine/Except
public EcsMask.Builder GetMask()
{
return EcsMask.New(_world);
}
public Singleton<T> Get<T>() where T : struct
{
return new Singleton<T>(_world.ID);