class in UnityEditor.Experimental.Animations
/
Hereda de:Object
Cambiar al ManualRecords 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 UnityEngine; using UnityEditor.Experimental.Animations;
public class RecordTransformHierarchy : MonoBehaviour { public AnimationClip clip;
private GameObjectRecorder m_Recorder;
void Start() { // Create recorder and record the script GameObject. m_Recorder = new GameObjectRecorder(gameObject);
// Bind all the Transforms on the GameObject and all its children. m_Recorder.BindComponentsOfType<Transform>(gameObject, true); }
void LateUpdate() { if (clip == null) return;
// Take a snapshot and record all the bindings values for this frame. m_Recorder.TakeSnapshot(Time.deltaTime); }
void OnDisable() { if (clip == null) return;
if (m_Recorder.isRecording) { // Save the recorded session to the clip. m_Recorder.SaveToClip(clip); } } }
currentTime | Returns the current time of the recording. (Read Only) |
isRecording | Returns true when the recorder is recording. (Read Only) |
root | The GameObject root of the animated hierarchy. (Read Only) |
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 component. |
BindComponentsOfType | 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 | ¿Debería el objeto estar oculto, guardado con la escena o modificable por el usuario? |
name | El nombre del objeto. |
GetInstanceID | Devuelve el id de la instancia del objeto. |
ToString | Returns the name of the GameObject. |
Destroy | Elimina un gameobject, componente o asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Hace que el objeto target no sea destruido automáticamente cuando se cargue una nueva escena. |
FindObjectOfType | Devuelve el primer objeto activo cargado de tipo type. |
FindObjectsOfType | Devuelve una lista de todos los objetos activos cargados de tipo type. |
Instantiate | Clona el objeto original y devuelve el clon. |
bool | ¿Existe el objeto? |
operator != | Compare si dos objetos se refieren a un objeto diferente. |
operator == | Compara dos referencias de objeto para ver si se refieren al mismo objeto. |