title: How to get selected toggle from toggle group?
body: <p>I have created one toggle group and now I want to retrieve selected toggle item with some easiest way possible.</p>
  
  <p><a href="https://i.stack.imgur.com/czC0W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/czC0W.png" alt="enter image description here"></a></p>
  
  <p>Share your side suggestions with me...</p>
  
  <p><strong>EDIT:</strong>
  Here you have ToggleGroup details:
  <a href="https://i.stack.imgur.com/X0zbt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X0zbt.png" alt="enter image description here"></a></p>
  
  <p>I was using this code to check:</p>
  
  <pre><code>public class RandomMatchMakerPanelController : MonoBehaviour
  {
  
  
  public Sprite defaultPlayerPhoto;
  //
  [Header ("Player-1")]
  public Image player1Photo;
  public Text player1NameText;
  public Text player1CountryText;
  public ToggleGroup player1BallGroup;
  
  [Header ("Player-2")]
  public Image player2Photo;
  public Text player2NameText;
  public Text player2CountryText;
  public ToggleGroup player2BallGroup;
  
  void OnEnable ()
  {
  //      StartCoroutine (CreateRandomMatches ());
          GetSelectedToggle ();
      ShowLocalPlayerDetails ();
  }
  
  private void ShowLocalPlayerDetails ()
  {
      if (DataCollection.localPlayer.ProfilePhoto == null)
          player1Photo.sprite = defaultPlayerPhoto;
      else
          player1Photo.sprite = DataCollection.localPlayer.ProfilePhoto;
      player1NameText.text = DataCollection.localPlayer.PlayerName;
      player1CountryText.text = DataCollection.localPlayer.Country;
  }
  
  private void GetSelectedToggle ()
  {
  //      Toggle[] ballToggles = player1BallGroup.GetComponentsInChildren&lt;Toggle&gt; ();
      foreach (Toggle toggle in player1BallGroup.ActiveToggles()) {
          Debug.Log ("toggle: "+ toggle.isOn);
      }
      // May have several selected toggles
  //      foreach (Toggle toggle in ballToggles) {
  //          if(toggle.isOn)
  //      }
  }
  
  IEnumerator CreateRandomMatches ()
  {
      yield return new WaitForSeconds (0.25f);
      RandomMatchMaker matchMaker = GameObject.FindGameObjectWithTag (GameConstants.TAG_NETWORK_MANAGER).GetComponent&lt;RandomMatchMaker&gt; ();
      matchMaker.FindInternetMatch ("Dodgels-");
  }
  
  public void OnBackButtonClick ()
  {
      SoundManager.Instance.PlayButtonClickSound ();
      Camera.main.SendMessage (GameConstants.ACTIVATE_RANDOM_MATCH_MAKER_PANEL, false, SendMessageOptions.DontRequireReceiver);
      Camera.main.SendMessage (GameConstants.ACTIVATE_RANDOM_PLAYER_GAMEPLAY, false, SendMessageOptions.DontRequireReceiver);
      Camera.main.SendMessage (GameConstants.ACTIVATE_MAIN_MENU_PANEL, true, SendMessageOptions.DontRequireReceiver);
  }
  }
  </code></pre>
  
  <p>At present nothing get displayed in Console though one toggle at a time remain always active.</p>