The Effect Obj Pool component serves as pool for effect and attack objects in the map.
When you’re creating a new map using the RTS Engine menu editor, this component is attached to an object called “AttackManager”.
While the Effect Obj Pool component doesn’t have any fields that you can assign, creating an effect object requires attaching the Effect Obj component which has the following fields:
- Code: Make sure that every effect object has a unique code so that the effect object pool can distinguish between different effect objects.
- Enable Life Time: When enabled, the effect object will have a life time during which it will be shown when activated. When disabled, the effect object will have to be manually hidden.
- Default Life Time: When life time is enabled, this is the default life time (in seconds) of the effect object.
- Disable Time: Time (in seconds) to keep displaying the effect object after it’s marked as disabled. During this time, the effect object won’t be able to be fetched to be re-used again by the effect object pool. This can be useful to allow time for a particle system that’s attached to the effect object to stop and not just disappear instantly.
- Spawn Position Offset: Offset the spawn position by this vector.
- On Enable Event: Methods from other components to call when the effect object is enabled.
- On Disable Event: Methods from other components to call when the effect object is disabled.