在Unity里点击按钮打开一个浏览器页面 点击关闭 关闭这个页面
using UnityEngine;
using System.Collections;
using System.Diagnostics;
public class diaoyong : MonoBehaviour {
public static Process C;
void Start () {
}
void Update () {
}
void OnGUI()
{
if (GUI.Button(new Rect(50, 50, 100, 30), "新浪"))
{
CallWeb();
}
if (GUI.Button(new Rect(200, 50, 100, 30), "关闭"))
{
C.Kill();
}
}
void CallWeb()
{
C = System.Diagnostics.Process.Start("IExplore.exe", "http://www.sina.com.cn/");
}
}