通过继承Button 重写DoStateTransition方法来监测Button的Interactable状态,外部可以在InteractableChanged添加绑定监听方法
public class MyButton : Button
{public event Action<bool> InteractableChanged;protected override void DoStateTransition(SelectionState state, bool instant){if (state == SelectionState.Disabled){InteractableChanged?.Invoke(interactable);}else if (state == SelectionState.Normal){InteractableChanged?.Invoke(interactable);}}
}