Enable and Disable PointerEnter EventTrigger on number of Buttons present in a single GameObject MenuButtons

In this picture u can see i have list of buttons under the MenuButtons GameObject. I want them to be non interactive + i dont want them to trigger OnPointer events as well when i enable my pannel to SetActiveTrue. And once the panel is SetActive false i want them to go interactive again.


 public void SettingsPanel()
 {

    PanelSettings.SetActive(true);
    foreach(Transform MenuButton in MenuButtons)
    {
        MenuButton.GetComponent<Button>().interactable = false;  //all button are non interactive at this point but i don't know how to disable them from firing those OnPointer events i have assigned to them in inspector.
        
    }
  }

You can override the EventTrigger class and have it not call the event if the button is not intractable
You cannot have any variables exposed to the inspector if you’re overriding the EventTrigger, so you need to find the button with code.

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class TriggerOverride : EventTrigger
{
    public Button _button = null;
    public Button button { get { if (_button == null) { _button = Get(); } return _button; } }
    //find the button on the object
    private Button Get()
    {
        return GetComponent<Button>();
    }

    //override on pointer enter so it only gets called when button is interactable
    public override void OnPointerEnter(PointerEventData eventData)
    {
        if (!button.interactable)
            return;
        base.OnPointerEnter(eventData);
        Debug.Log("On Enter");
    }
}