Unity打开.exe文件

这是一个相对简陋的方法,仅仅是打开了存储在Assets资源中的一个.exe文件而已,打开方式为Application.OpenURL:

using System.Collections;

using UnityEngine;

public class test: MonoBehaviour {

    private string pathURL;

	// Use this for initialization
	private void Start () 
	{
        pathURL = "file://" + Application.dataPath + "/StreamingAssets/20177261";
    }

	// Update is called once per frame
	private void Update () 
	{
        if (Input.GetKeyDown(KeyCode.O))
        {
            Open();
        }
	}

    public void Open()
    {
        Application.OpenURL(pathURL);  
    }
}
接下来会去探索如何将其保存到本地,手动去打开,有思路的1024可以给点建议。

你可能感兴趣的:(Unity3D)