【发布时间】:2017-12-25 08:23:47
【问题描述】:
当我使用 EditorUtiliy.OpenFolderPanel 方法获取操作系统上的目录路径时(Unity 2017.3 中的 macOSX,编辑器总是崩溃。当我在 Unity 2017.2 或更早版本的 Unity 中使用相同方法时,编辑器不会崩溃。
我该如何解决这个问题?请帮帮我。
感谢您的宝贵时间。
private void SetRootDirectory()
{
string path = Application.dataPath + "/Resources/root.txt";
string rootPath = EditorUtility.OpenFolderPanel("Select Location", Application.dataPath, ""); //editor is crashing because of this line
using (FileStream fs = new FileStream(path, FileMode.Create))
{
using (StreamWriter writer = new StreamWriter(fs))
{
writer.Write(rootPath);
}
}
AssetDatabase.Refresh();
}
【问题讨论】:
-
可能应该在 Unity 论坛中询问,因为这是特定于编辑器的
-
感谢@SurajS 的建议,我也只是在 UnityForums 中提问。 answers.unity.com/questions/1446417/…
-
2017.3有很多bug。很多。所以建议你回滚或等待任何补丁。
标签: unity3d unity-editor