Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.DataManagement.AssetBundlesTools.AsyncTaskHandler Class Reference

Detailed Description

An entity that handles tasks in the main thread.

Self destroying in case if Tasks is null during Update call.

Some external handler that need to simulate a task

void SomeFunctionThatNeedTaskLikeHandler()
{
// Variable that will contains an incrementing value for example.
int iterator = 0;
// Subscribing the TaskHandler (code below) of the per frame call.
AssetBundlesTools.AsyncTaskHandler.Active.Tasks += TaskHandler;
// Local function that will be used as task.
void TaskHandler()
{
if(iterator < 100)
{
// ----------------
// Doing something
// ----------------
iterator++; // Updating the iterator.
return; // Yielding the task.
}
// All actions in task are done.
// And we are ready to finalize the task.
// For this we just need to unsubscribe our handler.
AssetBundlesTools.AsyncTaskHandler.Active.Tasks -= TaskHandler;
}
}
Inheritance diagram for Doloro.DataManagement.AssetBundlesTools.AsyncTaskHandler:
Collaboration diagram for Doloro.DataManagement.AssetBundlesTools.AsyncTaskHandler:

Public Attributes

System.Action Tasks
 Tasks to per update call.
 

Static Public Attributes

static float RoundTime = 0.015f
 How many time can be spent on task calls. More...
 

Protected Member Functions

virtual async void Update ()
 

Properties

static AsyncTaskHandler Active [get]
 Returns already existed handler or instantiates new otherwise.
 

Member Data Documentation

◆ RoundTime

float Doloro.DataManagement.AssetBundlesTools.AsyncTaskHandler.RoundTime = 0.015f
static

How many time can be spent on task calls.

Single call are guarantees event if it takes more then this time.


The documentation for this class was generated from the following file: