UxrAnimatedComponent<T> Class

Base class to create components that animate properties. Animation components should support two main ways of usage:  

  • Adding and setting up component using Unity’s editor.
  • Adding and setting up component through scripting at runtime.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateXR.Core.Components.UxrComponent
            UltimateXR.Animation.UxrAnimatedComponent<T>
              UltimateXR.Animation.Lights.UxrAnimatedLightIntensity
              UltimateXR.Animation.Materials.UxrAnimatedMaterial
Namespace: UltimateXR.Animation
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public abstract class UxrAnimatedComponent<T> : UxrComponent
where T : UxrAnimatedComponent<T>


Type Parameters

 

T
Type of animated component
  The UxrAnimatedComponent<T> type exposes the following members.

Constructors

NameDescription
Protected methodUxrAnimatedComponent<T>

Properties

NameDescription
Public propertyAnimationMode Gets the animation mode.
Public propertyAnimationTime Gets the current animation time in seconds. The animation time is the scaled or unscaled time relative to the time the component was enabled.
Public propertyHasFinished Gets whether the animation finished.
Public propertyInterpolatedValueEnd Gets or sets the end value when the animation mode is set to Interpolate.
Public propertyInterpolatedValueStart Gets or sets the start value when the animation mode is set to Interpolate.
Public propertyInterpolatedValueWhenDisabled Gets or sets the value to set when the component is disabled, when the animation mode is set to Interpolate.
Public propertyInterpolationSettings Gets or sets the interpolation settings when the animation mode is set to Interpolate.
Public propertyNoiseDurationSeconds Gets or sets the animation duration in seconds when the animation mode is set to Noise.
Public propertyNoiseFrequency Gets or sets the noise frequency when the animation mode is set to Noise.
Public propertyNoiseOffset Gets or sets the noise offset when the animation mode is set to Noise.
Public propertyNoiseTimeStart Gets or sets the start time when the animation mode is set to Noise.
Public propertyNoiseValueEnd Gets or sets the end value when the animation mode is set to Noise.
Public propertyNoiseValueMax Gets or sets the noise max value when the animation mode is set to Noise.
Public propertyNoiseValueMin Gets or sets the noise min value when the animation mode is set to Noise.
Public propertyNoiseValueStart Gets or sets the start value when the animation mode is set to Noise.
Public propertySpeed Gets or sets the increment per second when the animation mode is set to Speed.
Public propertySpeedDurationSeconds Gets or sets the animation duration in seconds when the animation mode is set to Speed. Durations of 0 or less than 0 will be considered as infinite duration.
Public propertyUseUnscaledTime Gets or sets whether to use the unscaled time (unscaledTime instead of time .

Methods

NameDescription
Protected methodGetParameterValue Gets the current parameter value
Protected methodOnDisable Called each time the object is disabled. (Overrides UxrComponent.OnDisable().)
Protected methodOnEnable Called each time the object is enabled. Reset timer and set the curve state to unfinished. (Overrides UxrComponent.OnEnable().)
Protected methodOnFinished Called when the animation finished.
Protected methodRestoreOriginalValue Restores the animated component to the state before the animation started.
Protected methodSetParameterValue Sets the parameter value
Protected methodStartTimer (Re)Starts the animation timer.
Public methodStop(Boolean) Stops the animation on an object if it has an UxrAnimatedComponent<T> component currently attached.
Public methodStatic memberStop(GameObject, Boolean) Stops the animation on an object if it has an UxrAnimatedComponent<T> component currently attached.
Protected methodStatic memberToVector4 Converts a float value to a Vector4. Internally Vector4 values are used for everything but some animations only require to store a float value. The x component will be used to store the value.

Events

NameDescription
Public eventFinished Called when the animation finished.

Extension Methods

NameDescription
Public Extension MethodCheckSetEnabled Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.)
Public Extension MethodGetOrAddComponent<T> Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.)
Public Extension MethodGetPathUnderScene Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.)
Public Extension MethodGetSceneUid Gets an unique identifier string for the given component. (Defined by ComponentExt.)
Public Extension MethodGetUniqueScenePath Gets an unique path in the scene for the given component. It will include scene name, sibling and component indices to make it unique. (Defined by ComponentExt.)
Public Extension MethodLoopCoroutine Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.)
Public Extension MethodSafeGetComponentInParent<T> Gets the Component of a given type in the GameObject or any of its parents. It also works on prefabs, where regular GetComponentInParent(Type, Boolean) will not work: https://issuetracker.unity3d.com/issues/getcomponentinparent-is-returning-null-when-the-gameobject-is-a-prefab (Defined by ComponentExt.)
Public Extension MethodShowInInspector(Boolean)Overloaded.
Controls whether to show the current object in the inspector. (Defined by ObjectExt.)
Public Extension MethodShowInInspector(Boolean, Boolean)Overloaded.
Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.)
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.Animation Namespace