C# Class Foundation.Tasks.UnityTask

A task encapsulates future work that may be waited on. - Support running actions in background threads - Supports running coroutines with return results - Use the WaitForRoutine method to wait for the task in a coroutine
Inheritance: UnityEngine.CustomYieldInstruction, IDisposable
Afficher le fichier Open project: NVentimiglia/Unity3d-Foundation Class Usage Examples

Méthodes publiques

Свойство Type Description
DisableMultiThread bool
LogErrors bool
Strategy TaskStrategy

Protected Properties

Свойство Type Description
_action System.Action
_routine IEnumerator
_status TaskStatus

Méthodes publiques

Méthode Description
AddContinue ( Delegate action ) : void
Complete ( Exception ex = null ) : void

Runs complete logic, for custom tasks

Delay ( int millisecondTimeout ) : System.Threading.Tasks.Task
Delay ( int millisecondTimeout ) : void
DeserializeResult ( string json ) : void

For HTTP

Dispose ( ) : void
Start ( ) : void

Executes the task

UnityTask ( System.Action action ) : System

Creates a new background task

UnityTask ( System.Action action, TaskStrategy mode ) : System

Creates a new Task

UnityTask ( Exception ex ) : System

Creates a new Task in a Faulted state

UnityTask ( IEnumerator action ) : System

Creates a new Coroutine Task

UnityTask ( TaskStrategy mode ) : System

Creates a new task

Méthodes protégées

Méthode Description
Execute ( ) : void
OnRoutineComplete ( ) : void
OnTaskComplete ( ) : void
RunAsCoroutine ( ) : void
RunOnBackgroundThread ( ) : void
RunOnCurrentThread ( ) : void
RunOnMainThread ( ) : void

Private Methods

Méthode Description
UnityTask ( ) : System

Method Details

AddContinue() public méthode

public AddContinue ( Delegate action ) : void
action System.Delegate
Résultat void

Complete() public méthode

Runs complete logic, for custom tasks
public Complete ( Exception ex = null ) : void
ex System.Exception
Résultat void

Delay() public static méthode

public static Delay ( int millisecondTimeout ) : System.Threading.Tasks.Task
millisecondTimeout int
Résultat System.Threading.Tasks.Task

Delay() public static méthode

public static Delay ( int millisecondTimeout ) : void
millisecondTimeout int
Résultat void

DeserializeResult() public méthode

For HTTP
public DeserializeResult ( string json ) : void
json string
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Execute() protected méthode

protected Execute ( ) : void
Résultat void

OnRoutineComplete() protected méthode

protected OnRoutineComplete ( ) : void
Résultat void

OnTaskComplete() protected méthode

protected OnTaskComplete ( ) : void
Résultat void

RunAsCoroutine() protected méthode

protected RunAsCoroutine ( ) : void
Résultat void

RunOnBackgroundThread() protected méthode

protected RunOnBackgroundThread ( ) : void
Résultat void

RunOnCurrentThread() protected méthode

protected RunOnCurrentThread ( ) : void
Résultat void

RunOnMainThread() protected méthode

protected RunOnMainThread ( ) : void
Résultat void

Start() public méthode

Executes the task
public Start ( ) : void
Résultat void

UnityTask() public méthode

Creates a new background task
public UnityTask ( System.Action action ) : System
action System.Action
Résultat System

UnityTask() public méthode

Creates a new Task
public UnityTask ( System.Action action, TaskStrategy mode ) : System
action System.Action
mode TaskStrategy
Résultat System

UnityTask() public méthode

Creates a new Task in a Faulted state
public UnityTask ( Exception ex ) : System
ex System.Exception
Résultat System

UnityTask() public méthode

Creates a new Coroutine Task
public UnityTask ( IEnumerator action ) : System
action IEnumerator
Résultat System

UnityTask() public méthode

Creates a new task
public UnityTask ( TaskStrategy mode ) : System
mode TaskStrategy
Résultat System

Property Details

DisableMultiThread public_oe static_oe property

Forces use of a single thread for debugging
public static bool DisableMultiThread
Résultat bool

LogErrors public_oe static_oe property

Logs Exceptions
public static bool LogErrors
Résultat bool

Strategy public_oe property

Run execution path
public TaskStrategy Strategy
Résultat TaskStrategy

_action protected_oe property

protected Action,System _action
Résultat System.Action

_routine protected_oe property

protected IEnumerator _routine
Résultat IEnumerator

_status protected_oe property

protected TaskStatus _status
Résultat TaskStatus