Experimental: this API is experimental and might be changed or removed in the future.

GameObjectRecorder.BindComponent

切换到手册
public void BindComponent (Component component);

参数

component要绑定的组件。

描述

component 的所有属性添加绑定。

using UnityEngine;
using UnityEditor;
using UnityEditor.Experimental.Animations;

public class BindComponentScript : MonoBehaviour { void Start() { var recorder = new GameObjectRecorder(gameObject);

// Add bindings for all the properties of the Transform and BoxCollider components. recorder.BindComponent(transform); recorder.BindComponent(GetComponent<BoxCollider>()); } }