Version: 2023.2
LanguageEnglish
  • C#

AccessibilityHierarchy.GetLowestCommonAncestor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Accessibility.AccessibilityNode GetLowestCommonAncestor(Accessibility.AccessibilityNode firstNode, Accessibility.AccessibilityNode secondNode);

Parameters

firstNode The first node to find the lowest common ancestor of.
secondNode The second node to find the lowest common ancestor of.

Returns

AccessibilityNode The lowest common ancestor of the two given nodes, or null if there is no common ancestor.

Description

Retrieves the lowest common ancestor of two nodes in the hierarchy. The lowest common ancestor is the node that is the common node that both nodes share in their path to the root node of their branch in the hierarchy.