Skip to content

Instantly share code, notes, and snippets.

@brucevang
Created November 6, 2018 06:38
Show Gist options
  • Save brucevang/11857b100e147a8624dc57133e7ce94e to your computer and use it in GitHub Desktop.
Save brucevang/11857b100e147a8624dc57133e7ce94e to your computer and use it in GitHub Desktop.
Unity Set UI Active
public void OpenPanel() {
/* This turns on a panel
if (Panel != null) {
Panel.SetActive(true);
}
*/
// This toggles a panel
bool isActive = Panel.activeSelf;
Panel.SetActive(!isActive);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment