TransformExtensions.TryGetDepth(Transform, Transform, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.