Search code examples
unity-game-engineunity-editor

Unity 2017.3 Editor Crash when use EditorUtility.OpenFolderPanel


When I use EditorUtiliy.OpenFolderPanel method for getting directory path on operating system(macOSX in Unity 2017.3, the editor is crashed always. When I use the same method in Unity 2017.2 or older versions of Unity, the editor is not crashed.

How can I solve this problem? Please help me.

Thanks for your time.

 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();
}

Solution

  • Detailed Answer

    Thanks for the solution to Unity Team. They solved the problem in Unity 2018.1.

    Email details:

    Hey,

    Thanks a lot for reporting an issue.

    It appears that this bug has already been fixed in 2018.1. It is uncertain when this issue will be fixed for 2017.3, so I would suggest downgrading to the latest 2017.2 patch release.

    You can download latest patch releases of Unity from here: https://unity3d.com/unity/qa/patch-releases

    If you have any further questions, feel free to ask.

    Regards, Linas QA team