fgm24/Assets/Scripts/UI/DisableButtonOnpress.cs

15 lines
328 B
C#

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);
}
}