StateVisualizer Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The State Visualizer component adds animations to an object based on the states defined in a linked Interactive Element component. This component creates animation assets, places them in the MixedRealityToolkit.Generated folder and enables simplified animation keyframe setting through adding animatable properties to a target game object. To enable animation transitions between states, an Animator Controller asset is created and a default state machine is generated with associated parameters and transitions. This state machine can be viewed in Unity's Animator window.
public ref class StateVisualizer : UnityEngine::MonoBehaviour
[UnityEngine.RequireComponent(typeof(UnityEngine.Animator))]
public class StateVisualizer : UnityEngine.MonoBehaviour
[<UnityEngine.RequireComponent(typeof(UnityEngine.Animator))>]
type StateVisualizer = class
inherit MonoBehaviour
Public Class StateVisualizer
Inherits MonoBehaviour
- Inheritance
-
UnityEngine.MonoBehaviourStateVisualizer
- Attributes
-
UnityEngine.RequireComponentAttribute
Animator |
The Animator for this State Visualizer component. The State Visualizer component leverages the capabilities of the Unity animation system and requires the presence of an Animator component. |
Interactive |
The linked Interactive Element component for this State Visualizer. The State Visualizer component depends on the presence of a component that derives from BaseInteractiveElement. |
State |
A list of containers that map to the states in the attached Interactive Element component. |
States |
Add |
Add an animatable property to an animation target in a state container. |
Add |
Add an animation target to a state container. An animation target contains a reference to the target game object and a list of the animatable properties associated with the target. |
Get |
Get an animatable property by type. |
Get |
Get an animator state in the animator state machine by state name. |
Get |
Get a list of the shader animatable properties by type. |
Get |
Get state container given a state name. |
Remove |
Remove previously set keyframes. |
Set |
Set the animation clip for a state. |
Set |
Set the AnimationTransitionDuration for a state. |
Set |
Set the keyframes for a given animatable property. |
Set |
Initialize the Animator State Machine by creating new animator states to match the states in Interactive Element. |
Produkt | Wersje |
---|---|
MRTK2 Unity 2019 | 2.6.0, 2.7.0, 2.8.0 |
MRTK2 Unity 2020 | 2.6.0, 2.7.0, 2.8.0 |