Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ToggleVisibility(GameObject, bool)

Toggles the visible state of a GameObject.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public void ToggleVisibility(GameObject gameObject, bool includeDescendants)

Parameters

gameObject

GameObject on which to toggle visibility.

includeDescendants

Whether to include descendants.

Remarks

When includeDescendants is true, a descendant is set to the same visible state as the parent GameObject. When includeDescendants is false, the visibility state of descendants are not affected.