class in UnityEditor.Experimental.Animations
/
다음으로부터 상속:Object
매뉴얼로 전환Records the changing properties of a GameObject as the Scene runs and saves the information into an AnimationClip.
This class binds GameObject properties, records their values as they change in the running Scene, and saves the result in an AnimationClip. The recorded GameObject is called root in the class, and you can also bind the properties of any child of root.
See the following code example on how this class can be implemented and to set what gets recorded.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using UnityEditor.Experimental.Animations;
public class RecordTransformHierarchy : MonoBehaviour { public AnimationClip clip; public bool record = false;
private GameObjectRecorder m_Recorder;
void Start() { m_Recorder = new GameObjectRecorder(); m_Recorder.root = gameObject;
m_Recorder.BindComponent<Transform>(gameObject, true); }
void LateUpdate() { if (clip == null) return;
if (record) { m_Recorder.TakeSnapshot(Time.deltaTime); } else if (m_Recorder.isRecording) { m_Recorder.SaveToClip(clip); m_Recorder.ResetRecording(); } } }
currentTime | Returns the current time of the recording. |
isRecording | Returns true when the recorder is recording. |
root | The GameObject used for the recording. |
GameObjectRecorder | Create a new GameObjectRecorder. |
Bind | Binds a GameObject's property as defined by EditorCurveBinding. |
BindAll | Adds bindings for all of target's properties, and also for all the target's children if recursive is true. |
BindComponent | Adds bindings for all the properties of the first component of type T found in target, and also for all the target's children if recursive is true. |
GetBindings | Returns an array of all the bindings added to the recorder. |
ResetRecording | Reset the recording. |
SaveToClip | Saves the recorded animation into clip. |
TakeSnapshot | Forwards the animation by dt seconds, then record the values of the added bindings. |
hideFlags | Should the object be hidden, saved with the scene or modifiable by the user? |
name | The name of the object. |
GetInstanceID | Returns the instance id of the object. |
ToString | Returns the name of the GameObject. |
Destroy | Removes a gameobject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Makes the object target not be destroyed automatically when loading a new scene. |
FindObjectOfType | Returns the first active loaded object of Type type. |
FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |