Class TypeManager
Syntax
public static class TypeManager
Fields
BufferComponentTypeFlag
Declaration
public const int BufferComponentTypeFlag = 67108864
Field Value
ChunkComponentTypeFlag
Declaration
public const int ChunkComponentTypeFlag = 536870912
Field Value
ClearFlagsMask
Declaration
public const int ClearFlagsMask = 16777215
Field Value
DefaultBufferCapacityNumerator
BufferCapacity is by default calculated as DefaultBufferCapacityNumerator / sizeof(BufferElementDataType)
thus for a 1 byte component, the maximum number of elements possible to be stored in chunk memory before
the buffer is allocated separately from chunk data, is DefaultBufferCapacityNumerator elements.
For a 2 byte sized component, (DefaultBufferCapacityNumerator / 2) elements can be stored, etc...
Declaration
public const int DefaultBufferCapacityNumerator = 128
Field Value
HasNoEntityReferencesFlag
Declaration
public const int HasNoEntityReferencesFlag = 16777216
Field Value
ManagedComponentTypeFlag
Declaration
public const int ManagedComponentTypeFlag = 268435456
Field Value
MaximumChunkCapacity
Declaration
public const int MaximumChunkCapacity = 2147483647
Field Value
MaximumSupportedAlignment
Declaration
public const int MaximumSupportedAlignment = 16
Field Value
MaximumTypesCount
Declaration
public const int MaximumTypesCount = 10240
Field Value
ObjectOffset
Declaration
public static int ObjectOffset
Field Value
SharedComponentTypeFlag
Declaration
public const int SharedComponentTypeFlag = 134217728
Field Value
SystemStateSharedComponentTypeFlag
Declaration
public const int SystemStateSharedComponentTypeFlag = 167772160
Field Value
SystemStateTypeFlag
Declaration
public const int SystemStateTypeFlag = 33554432
Field Value
ZeroSizeInChunkTypeFlag
Declaration
public const int ZeroSizeInChunkTypeFlag = 1073741824
Field Value
Properties
AllTypes
Declaration
public static IEnumerable<TypeManager.TypeInfo> AllTypes { get; }
Property Value
Methods
CheckIsAllowedAsComponentData(Type, String)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIsAllowedAsComponentData(Type type, string baseTypeDesc)
Parameters
Type |
Name |
Description |
Type |
type |
|
String |
baseTypeDesc |
|
CheckIsAllowedAsManagedComponentData(Type, String)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void CheckIsAllowedAsManagedComponentData(Type type, string baseTypeDesc)
Parameters
Type |
Name |
Description |
Type |
type |
|
String |
baseTypeDesc |
|
ConstructComponentFromBuffer(Int32, Void*)
Declaration
public static object ConstructComponentFromBuffer(int typeIndex, void *data)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Void* |
data |
|
Returns
ConstructSystem(Type)
Construct a System from a Type. Uses the same list in GetSystems()
Declaration
public static ComponentSystemBase ConstructSystem(Type systemType)
Parameters
Type |
Name |
Description |
Type |
systemType |
|
Returns
ConstructSystem<T>()
Declaration
public static T ConstructSystem<T>()
where T : ComponentSystemBase
Returns
Type Parameters
ConstructSystem<T>(Type)
Declaration
public static T ConstructSystem<T>(Type systemType)
where T : ComponentSystemBase
Parameters
Type |
Name |
Description |
Type |
systemType |
|
Returns
Type Parameters
Equals(Object, Object, Int32)
Declaration
public static bool Equals(object left, object right, int typeIndex)
Parameters
Returns
Equals(Object, Void*, Int32)
Declaration
public static bool Equals(object left, void *right, int typeIndex)
Parameters
Returns
Equals(Void*, Void*, Int32)
Declaration
public static bool Equals(void *left, void *right, int typeIndex)
Parameters
Returns
Equals<T>(ref T, ref T)
Declaration
public static bool Equals<T>(ref T left, ref T right)
where T : struct
Parameters
Type |
Name |
Description |
T |
left |
|
T |
right |
|
Returns
Type Parameters
GetAllTypes()
Declaration
public static TypeManager.TypeInfo[] GetAllTypes()
Returns
GetEntityOffsets(Int32)
Declaration
public static TypeManager.EntityOffsetInfo*GetEntityOffsets(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
GetFastEqualityTypeInfo(TypeManager.TypeInfo)
Declaration
public static FastEquality.TypeInfo GetFastEqualityTypeInfo(TypeManager.TypeInfo typeInfo)
Parameters
Returns
GetHashCode(Object, Int32)
Declaration
public static int GetHashCode(object val, int typeIndex)
Parameters
Returns
GetHashCode(Void*, Int32)
Declaration
public static int GetHashCode(void *val, int typeIndex)
Parameters
Type |
Name |
Description |
Void* |
val |
|
Int32 |
typeIndex |
|
Returns
GetHashCode<T>(ref T)
Declaration
public static int GetHashCode<T>(ref T val)
where T : struct
Parameters
Type |
Name |
Description |
T |
val |
|
Returns
Type Parameters
GetSystemAttributes(Type, Type)
Get all the attribute objects of Type attributeType for a System.
Declaration
public static Attribute[] GetSystemAttributes(Type systemType, Type attributeType)
Parameters
Type |
Name |
Description |
Type |
systemType |
|
Type |
attributeType |
|
Returns
GetSystemName(Type)
Declaration
public static string GetSystemName(Type t)
Parameters
Type |
Name |
Description |
Type |
t |
|
Returns
GetSystems(WorldSystemFilterFlags, WorldSystemFilterFlags)
Return an array of all System types available to the runtime matching the WorldSystemFilterFlags. By default,
all systems available to the runtime is returned.
Declaration
public static IReadOnlyList<Type> GetSystems(WorldSystemFilterFlags filterFlags = WorldSystemFilterFlags.Default | WorldSystemFilterFlags.GameObjectConversion | WorldSystemFilterFlags.EntitySceneOptimizations | WorldSystemFilterFlags.ProcessAfterLoad | WorldSystemFilterFlags.HybridGameObjectConversion | WorldSystemFilterFlags.DotsRuntimeGameObjectConversion | WorldSystemFilterFlags.Editor | WorldSystemFilterFlags.All, WorldSystemFilterFlags requiredFlags = WorldSystemFilterFlags.Default)
Parameters
Returns
Type |
Description |
IReadOnlyList<Type> |
|
GetType(Int32)
Declaration
public static Type GetType(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
GetTypeCount()
Declaration
public static int GetTypeCount()
Returns
GetTypeIndex(Type)
Declaration
public static int GetTypeIndex(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
GetTypeIndex<T>()
Declaration
public static int GetTypeIndex<T>()
Returns
Type Parameters
GetTypeIndexFromStableTypeHash(UInt64)
Declaration
public static int GetTypeIndexFromStableTypeHash(ulong stableTypeHash)
Parameters
Type |
Name |
Description |
UInt64 |
stableTypeHash |
|
Returns
GetTypeInfo(Int32)
Declaration
public static TypeManager.TypeInfo GetTypeInfo(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
GetTypeInfo<T>()
Declaration
public static TypeManager.TypeInfo GetTypeInfo<T>()
Returns
Type Parameters
GetWriteGroupTypes(Int32)
Declaration
public static NativeArray<int> GetWriteGroupTypes(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
HasEntityReferences(Int32)
Declaration
public static bool HasEntityReferences(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
Initialize()
Initializes the TypeManager with all ECS type information. May be called multiple times; only the first call
will do any work. Always must be called from the main thread.
Declaration
public static void Initialize()
IsAssemblyReferencingEntities(Assembly)
Declaration
public static bool IsAssemblyReferencingEntities(Assembly assembly)
Parameters
Returns
IsAssemblyReferencingUnityEngine(Assembly)
Declaration
public static bool IsAssemblyReferencingUnityEngine(Assembly assembly)
Parameters
Returns
IsBuffer(Int32)
Declaration
public static bool IsBuffer(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsChunkComponent(Int32)
Declaration
public static bool IsChunkComponent(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsManagedComponent(Int32)
Declaration
public static bool IsManagedComponent(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsSharedComponent(Int32)
Declaration
public static bool IsSharedComponent(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsSystemAGroup(Type)
Declaration
public static bool IsSystemAGroup(Type t)
Parameters
Type |
Name |
Description |
Type |
t |
|
Returns
IsSystemStateComponent(Int32)
Declaration
public static bool IsSystemStateComponent(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsSystemStateSharedComponent(Int32)
Declaration
public static bool IsSystemStateSharedComponent(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
IsZeroSized(Int32)
Declaration
public static bool IsZeroSized(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
MakeChunkComponentTypeIndex(Int32)
Declaration
public static int MakeChunkComponentTypeIndex(int typeIndex)
Parameters
Type |
Name |
Description |
Int32 |
typeIndex |
|
Returns
RegisterUnityEngineObjectType(Type)
Declaration
public static void RegisterUnityEngineObjectType(Type type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Shutdown()
Removes all ECS type information and any allocated memory. May only be called once globally, and must be
called from the main thread.
Declaration
public static void Shutdown()
ThrowOnDisallowedComponentData(Type, Type, String)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void ThrowOnDisallowedComponentData(Type type, Type baseType, string baseTypeDesc)
Parameters
ThrowOnDisallowedManagedComponentData(Type, Type, String)
Declaration
[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
public static void ThrowOnDisallowedManagedComponentData(Type type, Type baseType, string baseTypeDesc)
Parameters