AimConstraint

class in UnityEngine.Animations

/

Inherits from:Behaviour


Implements interfaces:IConstraint

Switch to Manual

Description

约束一个对象相对于一个或多个源对象所在位置的方向,例如对象面向源对象的平均位置。

Variables

aimVector受约束对象面向的轴。
constraintActive激活或停用约束。
locked锁定静止的偏移和旋转。
rotationAtRest当源的总权重为 0 时使用的旋转。
rotationAxis受 AimConstraint 影响的轴。
rotationOffset表示相对于受约束方向的偏移。
sourceCount组件中设置的源的数量(只读)。
upVector向上矢量。
weight约束组件的权重。
worldUpObject世界向上对象,用于在世界向上类型为 AimConstraint.WorldUpType.ObjectUp 或 AimConstraint.WorldUpType.ObjectRotationUp 时计算世界向上矢量。
worldUpType世界向上矢量的类型。
worldUpVector当世界向上类型为 AimConstraint.WorldUpType.Vector 或 AimConstraint.WorldUpType.ObjectRotationUp 时使用的世界向上矢量。

Public Functions

AddSource添加约束源。
GetSource按索引获取约束源。
GetSources获取源的列表。
RemoveSource从组件中移除源。
SetSource设置指定索引处的源。
SetSources设置组件上的源列表。

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 ==比较两个对象引用,判断它们是否引用同一个对象。