Version: Unity 6.1 Alpha (6000.1)
LanguageEnglish
  • C#

VisualElement.Hierarchy.RemoveAt

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 void RemoveAt(int index);

Description

Removes a child, at the provided index, from the contentContainer of the current element.

Removes the element from both the child list and the layout list. This also releases the rendering data of the element at the index and its descendants. As a result, this is an O(n) operation where n is the total number of descendants.

If the index is out of range, an exception will be thrown.

Note: Avoid removing an element during a layout pass to prevent invalid operation exceptions and potential side effects.