ParentConstraint

class in UnityEngine.Animations

/

Inherits from:Behaviour


Implements interfaces:IConstraint

Switch to Manual

Description

约束对象相对于一个或多个源对象的方向和移动。受约束对象的行为如同处于源的层级中。

Variables

constraintActive激活或停用约束。
locked锁定静止的偏移和位置(移动和旋转)。
rotationAtRest当源的总权重为 0 时使用的旋转。
rotationAxis受 ParentConstraint 影响的旋转轴。
rotationOffsets相对于受约束方向的旋转偏移。
sourceCount组件中设置的源的数量(只读)。
translationAtRest对象在局部空间中的位置,当源的总权重为 0 时使用。
translationAxis受 ParentConstraint 影响的移动轴。
translationOffsets相对于受约束方向的移动偏移。
weight约束组件的权重。

Public Functions

AddSource添加约束源。
GetRotationOffset按索引获取与源相关的旋转偏移。
GetSource按索引获取约束源。
GetSources获取源的列表。
GetTranslationOffset按索引获取与源相关的旋转偏移。
RemoveSource从组件中移除源。
SetRotationOffset按索引设置与源相关的旋转偏移。
SetSource设置指定索引处的源。
SetSources设置组件上的源列表。
SetTranslationOffset按索引设置与源相关的移动偏移。

Inherited members

Variables

enabled启用的 Behaviour 可更新,禁用的 Behaviour 不可更新。
isActiveAndEnabledHas the Behaviour had active and enabled called?
gameObject此组件附加到的游戏对象。始终将组件附加到游戏对象。
tag此游戏对象的标签。
transform附加到此 GameObject 的 Transform。
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
name对象的名称。

Public Functions

BroadcastMessage调用此游戏对象或其任何子项中的每个 MonoBehaviour 上名为 methodName 的方法。
CompareTag此游戏对象是否使用 tag 进行了标记?
GetComponent如果游戏对象附加了类型为 type 的组件,则将其返回,否则返回 null。
GetComponentInChildren使用深度首次搜索返回 GameObject 或其任何子项中类型为 type 的组件。
GetComponentInParent返回 GameObject 或其任何父项中类型为 type 的组件。
GetComponents返回 GameObject 中类型为 type 的所有组件。
GetComponentsInChildren返回 GameObject 或其任何子项中类型为 type 的所有组件。
GetComponentsInParent返回 GameObject 或其任何父项中类型为 type 的所有组件。
SendMessage调用此游戏对象中的每个 MonoBehaviour 上名为 methodName 的方法。
SendMessageUpwards调用此游戏对象中的每个 MonoBehaviour 上或此行为的每个父级上名为 methodName 的方法。
GetInstanceID返回对象的实例 ID。
ToString返回 GameObject 的名称。

Static Functions

Destroy删除 GameObject、组件或资源。
DestroyImmediate立即销毁对象 /obj/。强烈建议您改用 Destroy。
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfType返回第一个类型为 type 的已加载的激活对象。
FindObjectsOfType返回所有类型为 type 的已加载的激活对象的列表。
Instantiate克隆 original 对象并返回克隆对象。

Operators

bool该对象是否存在?
operator !=比较两个对象是否引用不同的对象。
operator ==比较两个对象引用,判断它们是否引用同一个对象。