using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DisableButtonOnpress : MonoBehaviour { [SerializeField] private Button TargetButton; private void OnEnable() { TargetButton.onClick.AddListener(()=>TargetButton.interactable = false); } }