Click or drag to resize

BetterCoroutinesExtensionsStartBetterCoroutineLinked Method (GameObject, IEnumerator, UpdateLoop)

Starts a new coroutine with its lifetime linked to this gameobject. The coroutine will be stopped when the linked gameobject is disabled or destroyed.

Namespace:  Archon.SwissArmyLib.Coroutines
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static int StartBetterCoroutineLinked(
	this GameObject gameObject,
	IEnumerator enumerator,
	UpdateLoop updateLoop = UpdateLoop.Update
)
Request Example View Source

Parameters

gameObject
Type: GameObject
The gameobject to link the coroutine to.
enumerator
Type: System.CollectionsIEnumerator

[Missing <param name="enumerator"/> documentation for "M:Archon.SwissArmyLib.Coroutines.BetterCoroutinesExtensions.StartBetterCoroutineLinked(UnityEngine.GameObject,System.Collections.IEnumerator,Archon.SwissArmyLib.Utils.UpdateLoop)"]

updateLoop (Optional)
Type: Archon.SwissArmyLib.UtilsUpdateLoop
Which update loop should the coroutine be part of?

Return Value

Type: Int32
The id of the coroutine.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type GameObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also