1.找到System.Windows.Forms.dll,并放在project中的Plugins文件夹下。 “D:\Unity3D\Editor\Data\Mono\lib\mono\2.0\System.Windows.Forms.dll”
2.打开Player Settings 把.NET 2.0 Subset 改为.NET 2.0;
<span style="font-size:14px;">using UnityEngine;
using System.Collections;
using System.Windows.Forms;
public class screenshots : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void Screen(){
SaveFileDialog saveLog = new SaveFileDialog ();
saveLog.InitialDirectory="c:\\";
saveLog.Filter="Image File(*.JPG;*.BMP;*.PNG)|*.JPG;*.BMP;*.PNG|All files(*.*)|*.*";
D