кнопка Unity UI
using UnityEngine.UI;
public class ButtonScript : MonoBehaviour
{
public Button btn;
void Awake()
{
btn.onClick.AddListener(btnClicked);
}
void btnClicked()
{
Debug.Log("Button clicked");
}
}
Scorpion 37