Extend default OnValueChanged(bool) methods (Toggle)

Hi, at several points in my game I have two or more toggles which are connected to each other (One toggle gets enabled, other one gets disabled automatically). So far I get this to work with the following script attached to the toggle Game Objects:

public class SwitchToggles : MonoBehaviour {

    public Toggle otherToggle;
    private Toggle thisToggle;

    
	void Start ()
    {
        thisToggle = GetComponent<Toggle>();
        thisToggle.onValueChanged.AddListener((bool On) => Switch(On));
   }
	
	
    void Switch(bool isOn)
    {
        otherToggle.isOn = !isOn;
    }       

}

It works fine, it’s only a little bit annoying to write a script for such a little task and since I am using it sevral times throughout the game I have to add the script and GameObject every time. Therefore I’d like to write an extension method for GameObject with pops up as an option in the Inpector in the toggle component under Dynamic Bool (s. picture). the default SetActive dynamic bool method is not working here for me since I want the IsActive value to be opposite to the other toggle.82246-toggle.jpg

Unfortunately extension methods won’t show up in that menu. Another option would be to create a subclass of Toggle and use it instead of the built-in Toggle component. For example:

public class MyToggle : UnityEngine.UI.Toggle
{
    public void TurnOff (bool off)
    {
        this.isOn = !off;
    }
}

You could then select the MyToggle.TurnOff() method from the drop-down.

Why not use ToggleGroup?