我想要的效果:点击“彩蛋”按钮打开愤怒的小鸟.exe,但是运行后点击不知道为啥不可以
Button
Button的代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ButtonEvent : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnClick()
{
string url = Application.dataPath + "/愤怒的小鸟.exe";
Application.OpenURL(url); //打开
}
}
public void OnClick()
{
print("点击、、、、");
}
这个方法根本没有执行,因为你的按钮没有监听这个方法