I want to active deactive panels on button click can you help me with the code.

I have multiple panels in single scene i want to active deactive them through button click

  1. You will have to locate and store your panels in an array you might put them as a public field so you can add them through the inspector or you can use the GameObject.Find(“name”) however the first options is usually better for this exact purpose.
  2. Next you will need to iterate over the already created array of GameObjects and simply call the extension method SetActive(false).