Version: 2019.1
Language: 中文

DrivenRectTransformTracker

struct in UnityEngine

Switch to Manual

Description

可设计一个组件来驱动 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 方法。

Public Functions

Add添加要驱动的 RectTransform。
Clear清除正被驱动的 RectTransform 的列表。

Static Functions

StartRecordingUndoResume recording undo of driven RectTransforms.
StopRecordingUndoStop recording undo actions from driven RectTransforms.