PooledObject
A class in Root.Township, the global namespace.
Component on a prefab that can be reused through a PooledObjectDefinition pool instead of being destroyed. Used for short-lived local effects.
- Listed in Global namespace: P
- Inherits or implements
MonoBehaviour - Derived types
ActionGlyphAnimator,GenericCraftingNail,GenericCraftingPiece,WaterfallEffect,PooledDockVisual,BoilingParticles,PouringParticles,DevToolsBoard,NameBoardEmblem,PooledMenuSettings,AvailablePointCrystal,DelayedPooledObject,DestroyByTime,DurabilityStateChangeEffect,EcholocationEffect,EffectReleaseOnFade,EmberComposerFireEffect,PooledParticleSystem,PooledParticleSystemManipulator,FlintSpark,GhostBook,GlyphDisplayer,InGameLineGizmo,InGameSphereGizmo,InteractableInspector,MapMaskPiece,MeshEffect,MeshReplacePooledObject,ObjectVisualDouble,PageAutoAddEffect,PooledFireEffect,PooledTempWwiseAudio,PooledTextRenderer,QuestCompleteEffect,RendererGhost,ScaleLerpPooledObject,SkillHitTarget,SkillOrbEffect,SkillOrbInteractionSpline,SplineParticlesPooled,StatUpgradeEffect,SteelSongEffect,ToolBasedEffectBase,TrailLerper
Constructors
| Member | What it is |
|---|---|
PooledObject() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Properties
| Member | What it is |
|---|---|
bool IsReleased { get; private set; } | True while the instance sits in the pool unused. |
string Name { get; private set; } | The GameObject name, captured when the pool created it. |
BasicPooledObjectPool Pool { get; private set; } | The pool this instance belongs to. Null if it was not made by a pool. |
Events
| Member | What it is |
|---|---|
event PoolChangedHandler Released | Raised after the instance goes back to the pool. |
event PoolChangedHandler Requested | Raised when the instance is taken from the pool. |
Methods
| Member | What it is |
|---|---|
virtual void FinishRequest() | Called by the pool after placing a requested instance. Marks it in use and raises Requested. |
void Initialize(BasicPooledObjectPool pool) | Called by the pool on a new instance. Links it to the pool and marks it released. |
virtual void Release() | Returns the instance to its pool (deactivating it, or destroying it if the pool is full). Destroys it if it has no pool. |
virtual void ResetRun() | Hook for subclasses to restart their effect. Empty in the base class. |
protected virtual void OnDestroy() | Clears the Released and Requested handlers. |
1 private and internal method
Used in
Members of other types that take, return or hold a PooledObject:
AchievementEffectHandler.MoveQueue, AddonCraftingPart.addon, ForgedModel<TB, TA>.MeshEffectReleased, Smelter.activeOperationSmoke, RecipePlacer.currentPulsator, LiquidChunkVisuals.AddNewChunkVisuals, LiquidChunkVisuals.RemoveChunkVisuals, LiquidChunkVisuals.LiquidChunkData.CurrentVisuals, LiquidVisualChunkDefinition.SpawnVisuals, GenericCraftingNail.DisableTimer, WaterfallEffect.AttachTo, WaterfallEffectGenerator.pooled, HeatPoint.ActiveEffect, HeatSourceBase.activeEffect, ImpactDetectorSettings.LastEffect, PooledFixedImpactor.targetPooledObject, Phantom.activeVisionAttackEffect, SeedSpray.Seed.pooledObject, LiquidParticleMarker.ResetContainer, PouringParticles.StartParticlesAgain, DownedState.respawnOrbObject, EquipmentState.activeName, DevToolsBoard.activeSettings, QuickAccessSettingsBoard.activeSettings, ReturnToMainMenuAction.activeGlyph, ReturnToMainMenuAction.activeOrbObject, TextPopup.PooledObject, RespawnShrineSubscriberMarkController.subscriberMarks, AvailablePointCrystal.FadeOnRequest, BasicPooledObjectPool.pooledObjects, BasicPooledObjectPool.Release, BasicPooledObjectPool.Request, Bellows.particlesObjects, CastToSurfaceEffect.CastToGround, CastToSurfaceEffect.StoreCasted, ColoredExplosive.GetEffect, ColoredPooledParticleSpawner.SpawnedParticles, ColorFadeRelease.ResetSystems, ConglomerateDestroyByTime.CheckNearby, CrystalsAvailablePointManager.activeVisuals, CrystalsAvailablePointManager.temporaryVisuals, DestroyByTime.StartRuning, DurabilityGlobalSettings.GetEffect, DurabilityModule.SetupEffect, DurabilityStateChangeEffect.CleanUp, DurabilityStateChangeEffect.OnRequested, EffectReleaseOnFade.SetupRequest, EmberComposer.activeEffects, EmberComposerFireEffect.RequestedStart, EmissionControl.ResetSystems, EmissionShapeControl.ResetSystems, Explosive.GetEffect, GhostBook.OnRequest, InGameGizmosSettings.DrawLine, InGameGizmosSettings.DrawSphere, InGameLineGizmo.RequestedSetup, InGameSphereGizmo.RequestedSetup, InteractableInspector.OnRequested, LifeTimeEffect.pooledEffect, MaxLimitPooledObjectPool.activeObjects and 56 more.