Class TypeManager
The TypeManager registers all Components and Systems available at runtime. Information about components and systems can be retrieved at runtime via static methods on TypeManager. The Initialize() method must be invoked before the TypeManager can be used.
Namespace: Unity.Entities
Assembly: solution.dll
Syntax
public static class TypeManager
Fields
Name | Description |
---|---|
BakingOnlyTypeFlag | Bitflag set for component types decorated with the BakingTypeAttribute attribute. |
BufferComponentTypeFlag | Bitflag set for component types inheriting from IBufferElementData. |
ChunkComponentTypeFlag | Bitflag set for component types converted into Chunk Components. |
CleanupBufferComponentTypeFlag | Bitflag set for component types inheriting from ICleanupBufferElementData. |
CleanupComponentTypeFlag | Bitflag set for component types inheriting from ISystemStateComponentData. |
CleanupSharedComponentTypeFlag | Bitflag set for component types inheriting from ICleanupSharedComponentData. |
ClearFlagsMask | Bit mask to clear all flag bits from a TypeIndex /> |
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... |
EnableableComponentFlag | Bitflag set for component types inheriting from IEnableableComponent. |
HasNativeContainerFlag | Bitflag set for component types with NativeContainer data NativeContainerAttribute. |
HasNoEntityReferencesFlag | Bitflag set for component types that do not contain an Entity member. Entity members found in nested member types will cause this bitflag to not be set. |
IEquatableTypeFlag | Bitflag set for component types inheriting from IEquatable<T>. |
IRefCountedComponentFlag | Bitflag set for component types inheriting from IRefCounted. |
IsNotChunkSerializableTypeFlag | Bitflag set if a component is not appropriate to be included in chunk serialization. |
ManagedComponentTypeFlag | Bitflag set for component types requiring managed storage due to being a class type and/or containing managed references. |
ManagedSharedComponentTypeFlag | Bitflag set for component types inheriting from ISharedComponentData and requiring managed storage due to containing managed references. |
MaximumChunkCapacity | Maximum number of Entity instances stored in a given Chunk/> |
MaximumSupportedAlignment | Maximum platform alignment supported when aligning component data in a Chunk/> |
MaximumTypesCount | Maximum number of unique component types supported by the TypeManager/> |
ObjectOffset | Offset into managed objects to read instance data |
SharedComponentTypeFlag | Bitflag set for component types inheriting from ISharedComponentData. |
SystemStateSharedComponentTypeFlag | Obsolete. Use CleanupSharedComponentTypeFlaginstead. |
SystemStateTypeFlag | Obsolete. Use CleanupComponentTypeFlag instead. |
TemporaryBakingTypeFlag | Bitflag set for component types decorated with the TemporaryBakingTypeAttribute attribute. |
ZeroSizeInChunkTypeFlag | Bitflag set for component types which allocate 0 bytes in Chunk storage |
Properties
Name | Description |
---|---|
AllTypes | Enumerable list of all component TypeManager.TypeInfo values. |
Methods
Name | Description |
---|---|
CalculateFullNameHash(string) | Calculate a hash for a component's full type name. Used at TypeManager initialization internally. |
CallIRefCounted_Release(TypeIndex, IntPtr) | Used by codegen |
CallIRefCounted_Retain(TypeIndex, IntPtr) | Used by codegen |
ConstructComponentFromBuffer(TypeIndex, void*) | Used by codegen. Create an instance of a component type from a given buffer of data |
ConstructSystem(Type) | Construct a System from a Type. Uses the same list in GetSystems(WorldSystemFilterFlags, WorldSystemFilterFlags). |
ConstructSystem<T>() | Creates an instance of a system of type T. |
ConstructSystem<T>(Type) | Creates an instance of a system of System.Type. |
Equals(object, object, TypeIndex) | Compares two component instances to one another |
Equals(object, void*, TypeIndex) | Compares two component instances to one another |
Equals(void*, void*, TypeIndex) | Compares two component instances to one another |
Equals<T>(ref T, ref T) | Compares two component instances to one another |
GetAllTypes() | Array of all component TypeManager.TypeInfo values. |
GetDescendantCount(TypeIndex) | Returns how many component types are known to the TypeManager that inherit from a given component type |
GetEntityOffsets(TypeIndex, out int) | Gets a pointer to entity offsets for a given type index. |
GetFullNameHash(TypeIndex) | Retrieves a pre-calculated hash for a component's full type name. |
GetHashCode(object, TypeIndex) | Generates a hash for a given component instance |
GetHashCode(void*, TypeIndex) | Generates a hash for a given component instance |
GetHashCode<T>(ref T) | Generates a hash for a given component instance |
GetIEquatable_EqualsFn(TypeIndex) | Used by codegen |
GetIEquatable_GetHashCodeFn(TypeIndex) | Used by codegen |
GetSystemAttributes(Type, Type) | Get all the attribute objects of Type attributeType for a System. |
GetSystemName(Type) | Retrieve the name of a system via its type. |
GetSystemName(SystemTypeIndex) | Retrives the name of a system via its system index. |
GetSystemTypeFlags(SystemTypeIndex) | Retrieve type flags for a system index. |
GetSystemTypeIndex(Type) | Gets the SystemTypeIndex for the given system type. |
GetSystemTypeIndex<T>() | Returns the system index for System T. |
GetSystemTypeIndices(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. This version avoids unnecessary reflection. |
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. Prefer GetSystemTypeIndices over this to avoid unnecessary reflection. |
GetType(TypeIndex) | Gets the System.Type for the component represented by TypeIndex. |
GetTypeCount() | Gets the total number of components managed by the TypeManager. |
GetTypeIndex(Type) | Fetches the TypeIndex for a given System.Type. |
GetTypeIndexFromStableTypeHash(ulong) | Returns the TypeIndex for a given StableTypeHash |
GetTypeIndex<T>() | Fetches the TypeIndex for a given T. |
GetTypeInfo(TypeIndex) | Retrieve the TypeInfo for the TypeIndex. |
GetTypeInfo<T>() | Retrieve the TypeInfo for the component T. |
GetWriteGroupTypes(TypeIndex) | Used by codegen. Returns list of all type indices for components who have a WriteGroup on the provided type |
GetWriteGroups(in TypeInfo) | Retrieves a pointer to an array of WriteGroups for the provided TypeInfo. |
HasDescendants(TypeIndex) | Returns if any component inherits from the provided TypeIndex |
HasEntityReferences(TypeIndex) | |
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. |
IsAssemblyReferencingEntities(Assembly) | Determines if an assembly refers to Unity.Entities.dll |
IsBakingOnlyType(TypeIndex) | |
IsBuffer(TypeIndex) | |
IsChunkComponent(TypeIndex) | |
IsCleanupComponent(TypeIndex) | |
IsCleanupSharedComponent(TypeIndex) | |
IsDescendantOf(TypeIndex, TypeIndex) | Used to determine if a component inherits from another component type |
IsEnableable(TypeIndex) | |
IsEnableableType(TypeIndex) | |
IsIEquatable(TypeIndex) | |
IsManagedComponent(TypeIndex) | |
IsManagedSharedComponent(TypeIndex) | |
IsManagedType(TypeIndex) | |
IsSharedComponentType(TypeIndex) | |
IsSystemAGroup(Type) | Check if the provided type is a SystemGroup. |
IsSystemManaged(Type) | Check if the provided type is a managed system. |
IsSystemStateComponent(TypeIndex) | Obsolete. Use IsCleanupComponent instead. |
IsSystemStateSharedComponent(TypeIndex) | Obsolete. Use IsCleanupSharedComponent instead. |
IsSystemType(Type) | Determines if a given type is a System type (e.g. ISystem, SystemBase). |
IsTemporaryBakingType(TypeIndex) | |
IsZeroSized(TypeIndex) | |
MakeChunkComponentTypeIndex(TypeIndex) | Creates a new TypeIndex that allows the passed in 'typeindex' to be used as a chunk component. |
RegisterUnityEngineObjectType(Type) | Register a UnityEngine.Object type with the TypeManager. |
SetIEquatable_EqualsFn(int, Delegate, bool) | Used by codegen |
SetIEquatable_GetHashCodeFn(int, Delegate, bool) | Used by codegen |
SetIRefCounted_ReleaseFn(int, RefCountDelegate, bool) | Used by codegen |
SetIRefCounted_RetainFn(int, RefCountDelegate, bool) | Used by codegen |
Shutdown() | Removes all ECS type information and any allocated memory. May only be called once globally, and must be called from the main thread. |
SortSystemTypesInCreationOrder(List<Type>) | Sorts a list of system types based on rules defined via the CreateBeforeAttribute and CreateAfterAttribute. |
SortSystemTypesInCreationOrder(NativeList<SystemTypeIndex>) | Sort the provided system type indices by their systems' CreateAfter and CreateBefore attributes, for the purposes of creating them in an order that respects said constraints. For use in implementing custom world creation, such as with ICustomBootstrap. |