TransformExtensions Class

Definition

Extension methods for Unity's Transform class

C++
public ref class TransformExtensions abstract sealed
Inheritance
TransformExtensions

Methods

EnumerateAncestors(Transform, Boolean)

Enumerates the ancestors of the specified transform.

EnumerateHierarchy(Transform, ICollection<Transform>)

Enumerates all children in the hierarchy starting at the root object except for the branches in ignore.

EnumerateHierarchy(Transform)

Enumerates all children in the hierarchy starting at the root object.

FindAncestorComponent<T>(Transform, Boolean)

Find the first component of type T in the ancestors of the specified transform.

GetChildRecursive(Transform, String)

Walk hierarchy looking for named transform

GetColliderBounds(Transform)

Calculates the bounds of all the colliders attached to this GameObject and all its children

GetDepth(Transform)

Gets the hierarchical depth of the Transform from its root. Returns -1 if the transform is the root.

GetFullPath(Transform, String, String)

An extension method that will get you the full path to an object.

InverseTransformSize(Transform, Vector3)

Transforms the size from world to local.

IsParentOrChildOf(Transform, Transform)

Checks if the provided transforms are child/parent related.

TransformSize(Transform, Vector3)

Transforms the size from local to world.

TryGetDepth(Transform, Transform, Int32)

Tries to get the hierarchical depth of the Transform from the specified parent. This method is recursive.

Applies to

Produit Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0