UxrAnimatedMaterial.AnimateInterpolation Method

Starts a material parameter animation using an interpolation curve

Namespace: UltimateXR.Animation.Materials
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static UxrAnimatedMaterial AnimateInterpolation(
	GameObject gameObject,
	int materialSlot,
	UxrMaterialMode materialMode,
	UxrMaterialParameterType parameterType,
	string parameterName,
	Vector4 startValue,
	Vector4 endValue,
	UxrInterpolationSettings settings,
	Action finishedCallback = null
)

Parameters

 

gameObject
Type: GameObject
The GameObject with the material to apply the animation to
materialSlot
Type: System.Int32
The renderer material slot where the material is
materialMode
Type: UltimateXR.Animation.Materials.UxrMaterialMode
The material mode. Use instance to animate the material of a single object, use shared to also affect all other objects that share the same material
parameterType
Type: UltimateXR.Animation.Materials.UxrMaterialParameterType
Selects the type of the parameter to animate
parameterName
Type: System.String
Selects the name of the parameter to animate. This name is the name in the shader, not in the inspector!
startValue
Type: Vector4
The start value. For int/float values use .x, for Vector2 use x and y. For Vector3 use x, y, z. etc.
endValue
Type: Vector4
The end value. For int/float values use .x, for Vector2 use x and y. For Vector3 use x, y, z. etc.
settings
Type: UltimateXR.Animation.Interpolation.UxrInterpolationSettings
The interpolation settings with the curve parameters
finishedCallback (Optional)
Type: System.Action
Optional callback when the animation finished

Return Value

Type: UxrAnimatedMaterial
The animation component

See Also

Reference

UxrAnimatedMaterial Class
UltimateXR.Animation.Materials Namespace