unity3d 调用 web 窗体 跟 windows 窗体 .exe
1 cs
using UnityEngine;
using System.Collections;
using System.Diagnostics;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
**
}
// Update is called once per frame
void OnGUI(){
if(GUI.Button(new Rect(50,50,100,30),"点击")){
//Process.Start("D:\SixText\Assets\Scripts\WindowsFormsApplication4\
WindowsFormsApplication4\obj\Debug\WindowsFormsApplication4.exe");
Process.Start("IExplore.exe");//也可以是 Process.Start("IExplore.exe","http://
127.0.0.1/phpinfo.php");
}
}
}
2 js
function OnGUI() {
if(GUI.Button(Rect(80,50,50,50),"点击"))
{
//绝对路径调用.exe
System.Diagnostics.Process.Start("D:\SixText\Assets\Scripts\
WindowsFormsApplication4\WindowsFormsApplication4\obj\Debug\
WindowsFormsApplication4.exe");
//相对路径调用 web 网页格式
System.Diagnostics.Process.Start("IExplore.exe",Application+dataPath+"/
New Foleder/phpinfo.php");