Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Coroutines.CoroutineService Class Reference

The CoroutineService allows any system to start a Unity coroutine, even if that system is not a MonoBehaviour or associated with a GameObject. Beamable runs many coroutines per player instance to manage multiple networking based resources. All coroutines are routed through the CoroutineService. The CoroutineService is a MonoBehaviour itself, and all coroutines are associated to the related GameObject. Use the StartNew method to start a coroutine. More...

Inheritance diagram for Beamable.Coroutines.CoroutineService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Coroutines.CoroutineService:
Collaboration graph
[legend]

Public Member Functions

virtual Coroutine StartNew (string context, IEnumerator enumerator)
 Start a new Coroutine. The Coroutine will be attached to the GameObject that the CoroutineService is connected to. More...
 
void StopAll (string context)
 Stop all Coroutines for a given context. You can start Coroutines with the StartNew method. More...
 

Properties

Action EverySecond
 A utility function that triggers every game second. The callback in this function will happen in a Coroutine context.
 

Detailed Description

The CoroutineService allows any system to start a Unity coroutine, even if that system is not a MonoBehaviour or associated with a GameObject. Beamable runs many coroutines per player instance to manage multiple networking based resources. All coroutines are routed through the CoroutineService. The CoroutineService is a MonoBehaviour itself, and all coroutines are associated to the related GameObject. Use the StartNew method to start a coroutine.

Member Function Documentation

◆ StartNew()

virtual Coroutine Beamable.Coroutines.CoroutineService.StartNew ( string  context,
IEnumerator  enumerator 
)
inlinevirtual

Start a new Coroutine. The Coroutine will be attached to the GameObject that the CoroutineService is connected to.

Parameters
contextA context is a semantic grouping of Coroutines. Many Coroutines can be running at the same time, so the context helps organize them. You can use the StopAll method to stop all Coroutines of a given context.
enumeratorThe Coroutine function
Returns
A Unity Coroutine

◆ StopAll()

void Beamable.Coroutines.CoroutineService.StopAll ( string  context)
inline

Stop all Coroutines for a given context. You can start Coroutines with the StartNew method.

Parameters
contextA context is a semantic grouping of Coroutines. Many Coroutines can be running at the same time, so the context helps organize them.

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