TLimenTickable
Overview
TLimenTickable is a template class designed to encapsulate the logic for managing a tickable function. It uses Unreal Engine's FWorldDelegates::OnWorldTickEnd delegate to ensure that the tickable function is called at the end of each world tick. The class provides methods to start, stop, and check if it is currently ticking.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| Functor | Public | A lambda function that defines the task to be executed on each tick. |
| Args | Private | A tuple containing the arguments passed to the tickable function. |
| Handle | Private | A delegate handle used to manage the registration of the tickable function with the world tick event. |
| bLazyIsTicking | Private | A mutable boolean flag that caches whether the tickable function is currently ticking. |
Functions
Return Type | Signature | Description |
|---|---|---|
|
| Starts the tickable function if it is not already running. |
|
| Stops the tickable function if it is currently running. |
|
| Returns whether the tickable function is currently ticking. |
|
| Assigns a new tickable function and starts it if it was not already running. |
Usage & Implementation Notes
The class uses Unreal Engine's
FWorldDelegates::OnWorldTickEndto ensure that the tickable function is called at the end of each world tick.The tickable function can be assigned using the assignment operator, which will automatically start it if it was not already running.
The class ensures that the tickable function is stopped when the object is destroyed.