Upravit

Sdílet prostřednictvím


TransformExtensions.TryGetDepth(Transform, Transform, Int32) Method

Definition

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

public:
 static bool TryGetDepth(UnityEngine::Transform ^ target, UnityEngine::Transform ^ parent, int % depth);
public static bool TryGetDepth (UnityEngine.Transform target, UnityEngine.Transform parent, ref int depth);
static member TryGetDepth : UnityEngine.Transform * UnityEngine.Transform * int -> bool
Public Function TryGetDepth (target As Transform, parent As Transform, ByRef depth As Integer) As Boolean

Parameters

target
UnityEngine.Transform

The transform to get the depth for

parent
UnityEngine.Transform

The starting transform to look for the target transform in

depth
Int32

The depth of the target transform

Returns

'true' if the depth could be retrieved, or 'false' because the transform is a root transform.

Applies to