1、首先需要从unity打开外部文件夹并选择文件的功能,具体操作如下:
首先创建一个单独的类,用来储存打开的系统窗口的设置,下面的变量没有特殊要求不需要做任何改动:
using UnityEngine; using System.Collections; using System; using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public class OpenFileName {
public int structSize = 0; public IntPtr dlgOwner =IntPtr.Zero; public IntPtr instance = IntPtr.Zero; public String filter = null; public String customFilter = null; public int maxCustFilter = 0; public int filterIndex = 0; public String file = null; public int maxFile = 0; public String fileTitle = null; public int maxFileTitle = 0; public String initialDir = null; public String title = null;
|