Class System_ObjectPool<TObject>
Inheritance
ComponentSystemBase
SystemBase
System_ObjectPool<TObject>
Inherited Members
SystemBase.Dependency
SystemBase.CheckedStateRef
SystemBase.CompleteDependency()
SystemBase.Entities
SystemBase.Job
SystemBase.Update()
SystemBase.GetComponent<T>(Entity)
SystemBase.SetComponent<T>(Entity, T)
SystemBase.HasComponent<T>(Entity)
SystemBase.HasBuffer<T>(Entity)
SystemBase.GetEntityStorageInfoLookup()
SystemBase.GetStorageInfoFromEntity()
SystemBase.Exists(Entity)
ComponentSystemBase.Enabled
ComponentSystemBase.EntityQueries
ComponentSystemBase.GlobalSystemVersion
ComponentSystemBase.LastSystemVersion
ComponentSystemBase.EntityManager
ComponentSystemBase.World
ComponentSystemBase.SystemHandle
ComponentSystemBase.SystemHandleUntyped
ComponentSystemBase.Time
ComponentSystemBase.WorldUpdateAllocator
ComponentSystemBase.OnCreate()
ComponentSystemBase.OnStartRunning()
ComponentSystemBase.OnStopRunning()
ComponentSystemBase.OnDestroy()
ComponentSystemBase.ShouldRunSystem()
ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
ComponentSystemBase.GetSharedComponentTypeHandle<T>()
ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
ComponentSystemBase.GetEntityTypeHandle()
ComponentSystemBase.RequireForUpdate(EntityQuery)
ComponentSystemBase.RequireAnyForUpdate(params EntityQuery[])
ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
ComponentSystemBase.RequireForUpdate<T>()
ComponentSystemBase.RequireSingletonForUpdate<T>()
ComponentSystemBase.HasSingleton<T>()
ComponentSystemBase.GetSingleton<T>()
ComponentSystemBase.GetSingletonRW<T>()
ComponentSystemBase.TryGetSingleton<T>(out T)
ComponentSystemBase.TryGetSingletonBuffer<T>(out DynamicBuffer<T>)
ComponentSystemBase.SetSingleton<T>(T)
ComponentSystemBase.GetSingletonEntity<T>()
ComponentSystemBase.TryGetSingletonEntity<T>(out Entity)
ComponentSystemBase.GetEntityQuery(params ComponentType[])
ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
ComponentSystemBase.GetEntityQuery(params EntityQueryDesc[])
ComponentSystemBase.GetEntityQuery(in EntityQueryBuilder)
Assembly: fwt.core.ecs.dll
Syntax
public abstract class System_ObjectPool<TObject> : SystemBase where TObject : Object
Type Parameters
Fields
_maxObjectsInPool
Declaration
protected int _maxObjectsInPool
Field Value
Properties
MaxObjectsInPool
Declaration
public virtual int MaxObjectsInPool { get; set; }
Property Value
ObjectsPool
Declaration
public Dictionary<int, List<TObject>> ObjectsPool { get; }
Property Value
PoolObjectsRoot
Declaration
protected Transform PoolObjectsRoot { get; }
Property Value
| Type |
Description |
| Transform |
|
PrefabIdByObjectId
Declaration
public Dictionary<int, int> PrefabIdByObjectId { get; }
Property Value
Methods
Declaration
protected virtual Transform CreateObjectsRootTransform()
Returns
| Type |
Description |
| Transform |
|
DestroyObject(TObject)
Declaration
protected void DestroyObject(TObject obj)
Parameters
| Type |
Name |
Description |
| TObject |
obj |
|
Declaration
protected TObject ExtractObjectFromPool(int prefabId)
Parameters
| Type |
Name |
Description |
| int |
prefabId |
|
Returns
GetPrefabId(int)
Declaration
protected int? GetPrefabId(int objectId)
Parameters
| Type |
Name |
Description |
| int |
objectId |
|
Returns
GetPrefabId(TObject)
Declaration
protected int? GetPrefabId(TObject obj)
Parameters
| Type |
Name |
Description |
| TObject |
obj |
|
Returns
Instantiate(TObject, bool)
Declaration
public TObject Instantiate(TObject prefab, bool isWorldPositionStays)
Parameters
| Type |
Name |
Description |
| TObject |
prefab |
|
| bool |
isWorldPositionStays |
|
Returns
Declaration
public TObject Instantiate(TObject prefab, Transform parent, bool isWorldPositionStays)
Parameters
| Type |
Name |
Description |
| TObject |
prefab |
|
| Transform |
parent |
|
| bool |
isWorldPositionStays |
|
Returns
OnUpdate()
Implement OnUpdate() to perform the major work of this system.
Declaration
protected override void OnUpdate()
Overrides
Unity.Entities.SystemBase.OnUpdate()
PutObjectToPool(int, TObject)
Declaration
protected bool PutObjectToPool(int prefabId, TObject instance)
Parameters
| Type |
Name |
Description |
| int |
prefabId |
|
| TObject |
instance |
|
Returns
PutObjectToPool(TObject)
Declaration
protected bool PutObjectToPool(TObject obj)
Parameters
| Type |
Name |
Description |
| TObject |
obj |
|
Returns
PutObjectToPoolOrDestroy(TObject)
Declaration
protected void PutObjectToPoolOrDestroy(TObject obj)
Parameters
| Type |
Name |
Description |
| TObject |
obj |
|
RegisterCreatedInstance(int, int)
Declaration
protected virtual void RegisterCreatedInstance(int prefabId, int instanceId)
Parameters
| Type |
Name |
Description |
| int |
prefabId |
|
| int |
instanceId |
|
ReleaseInstance(TObject)
Declaration
public bool ReleaseInstance(TObject instance)
Parameters
| Type |
Name |
Description |
| TObject |
instance |
|
Returns
UnregisterCreatedInstance(int)
Declaration
protected virtual void UnregisterCreatedInstance(int instanceId)
Parameters
| Type |
Name |
Description |
| int |
instanceId |
|
UnregisterCreatedInstance(TObject)
Declaration
protected virtual void UnregisterCreatedInstance(TObject instance)
Parameters
| Type |
Name |
Description |
| TObject |
instance |
|
Extension Methods