UxrAnimatedMaterial.Animate Method
Starts an animation at a constant speed
Namespace: UltimateXR.Animation.Materials
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static UxrAnimatedMaterial Animate(
GameObject gameObject,
int materialSlot,
UxrMaterialMode materialMode,
UxrMaterialParameterType parameterType,
string parameterName,
Vector4 speed,
float durationSeconds = -1f,
bool useUnscaledTime = false,
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! - speed
- Type: Vector4
The animation speed. For int/float values use .x, for Vector2 use x and y. For Vector3 use x, y, z. etc. - durationSeconds (Optional)
- Type: System.Single
Duration in seconds of the animation. Use a negative value to keep updating until stopped manually. - useUnscaledTime (Optional)
- Type: System.Boolean
If it is true then Time.unscaledTime will be used to count seconds. By default it is false meaning Time.time will be used instead. Time.time is affected by Time.timeScale which in many cases is used for application pauses or bullet-time effects, while Time.unscaledTime is not. - 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