1️⃣. Unity本地化支持打开系统文件选择框 ;
2️⃣. 同时支持Mac端和Windows端 ;
3️⃣. 下一步计划实现安卓和苹果端的本地文件管理功能 , 大家支持下吧 ?
很简单,使用我提供的插件:
- 支持Windows
- 支持Mac
- 支持多选
- 支持选定文件类型
- 支持选定文件夹
- 支持打开窗口名称定义
1. 图示 ↓
2. 使用代码部分展示 ↓
/// <summary>
/// 获取文件路径实例
/// </summary>
/// <returns>The file path.</returns>
private string[] GetFilePath()
{
string[] path = { null };
string[] strs = StandaloneFileBrowser.OpenFilePanel("打开用户数据文件", "%HOMEDRIVE/Desktop%", "", false);
if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
{
if (strs.Length > 0)
{
path = strs;
}
else
{
Debug.Log("用户取消选择");
}
}
else if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor)
{
if (strs.Length > 0)
{
path = strs;
}
else
{
Debug.Log("用户取消选择");
}
}
return path;
}