可设计一个组件来驱动 RectTransform。DrivenRectTransformTracker 结构用于指定其正在驱动的 RectTransform。
Driving a RectTransform means that the values of the driven RectTransform are controlled by that component. These driven values cannot be edited in the Inspector (they are shown as disabled). They also won't be saved when saving a Scene, which prevents undesired Scene file changes.
无论何时该组件正在更改被驱动 RectTransform 的值,其都应首先调用 Clear 方法,然后使用 Add 方法来添加其正在驱动的所有 RectTransform。此外还应在该组件的 OnDisable 回调中调用 Clear 方法。
StartRecordingUndo | Resume recording undo of driven RectTransforms. |
StopRecordingUndo | Stop recording undo actions from driven RectTransforms. |