[Unity] UI的使用, 按钮事件

63 阅读1分钟

使用新版的按钮

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ButtonTest : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void ButtonClickDemo()
    {
        Debug.Log("按钮被点击");
    }
}

image.png