MonoBehaviourExt.LoopCoroutine Method

Creates a coroutine that simplifies executing a loop during a certain amount of time.

Namespace: UltimateXR.Extensions.Unity
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static IEnumerator LoopCoroutine(
	this MonoBehaviour monoBehaviour,
	float durationSeconds,
	Action<float> loopAction,
	UxrEasing easing = UxrEasing.Linear,
	bool forceLastT1 = false
)


Parameters

 

monoBehaviour
Type: MonoBehaviour
Caller
durationSeconds
Type: System.Single
Time in seconds of the interpolation
loopAction
Type: System.Action(Single)
The action to perform on each loop step. The action receives the interpolation value t [0.0, 1.0] as parameter.
easing (Optional)
Type: UltimateXR.Animation.Interpolation.UxrEasing
Easing to use in the interpolation (linear by default)
forceLastT1 (Optional)
Type: System.Boolean
Forces a last loop step with t = 1.0f exactly.

Return Value

Type: IEnumerator
Coroutine enumerator

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MonoBehaviour. 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

Reference

MonoBehaviourExt Class
UltimateXR.Extensions.Unity Namespace