title: How to use Unity Toggle Check Function (checked and unchecked)
body: <p>I'm trying to toggle. When I click on the toggle (if it is on I mean checked), it closes some gameobject, if I click on the toggle (if it is off I mean unchecked) it opens some gameobject but I don't know which function unity
  <code>toggle.onselect</code>?
  <code>toggle.onValuesChanged</code>? or others which one</p>
  
  <pre><code>public GameObject controlledObject;
  public NamesGet nameController;
  public Text text;
  public Button button;
  public Toggle toggle;
  private bool deneme;
  public void FixedUpdate()
  {
      text.text = controlledObject.name;
  
      if(?????????)
      {
          controlledObject.SetActive(!controlledObject.activeSelf);
  
      }
  }
  </code></pre>