文档

Unity Engine

Download Unity

Unity Engine

TransformRef

A reference to the transform of an entity, which can be part of a transform hierarchy.
阅读时间1 分钟最后更新于 4 天前

Definition

public readonly struct TransformRef : IQueryTypeParameter

Properties

Property

Description

HasHierarchyReturns whether this transform is currently part of a hierarchy.
IsValidWhether this reference points to a transform.
LocalPositionThe position relative to the parent, or to the world if the transform has no parent.
LocalRotationThe rotation relative to the parent, or to the world if the transform has no parent.
LocalScaleThe scale relative to the parent, or to the world if the transform has no parent.

Methods

Method

Description

CalculateLocalToWorldComputes the matrix that transforms from this transform's local space to world space.
CalculateWorldPositionAndRotationGets the world-space position and rotation.
GetChildGets the child entity at the specified index.
GetChildCountGets the number of direct children of this transform.
GetChildEntitiesGets all child entities.
GetLocalPositionAndRotationGets the local (parent-relative) position and rotation.
GetParentGets the parent entity of this transform.
SetLocalPositionAndRotationSets the local (parent-relative) position and rotation to the provided values.
SetLocalTransformSets the local (parent-relative) position, rotation, and scale to the provided values.
SetWorldPositionAndRotationSets the world-space position and rotation to the provided values.