Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Clear()

Resets the hierarchy to an empty state, removing all nodes and the screen reader focus.
Read time 1 minuteLast updated 12 days ago

Definition

public void Clear()

Remarks

Warning: When this hierarchy is the _activeHierarchy, this method has a non-trivial cost on the following platforms:
  • iOS: Clearing the hierarchy has a high cost that scales with its size. Avoid calling this method frequently in performance-sensitive code.
  • macOS: Clearing the hierarchy has a moderate cost that scales with its size. Calling this method frequently can affect performance.
Clearing an inactive hierarchy has no native cost.