Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug EditorUtility.OpenFilePanel causes error

Discussion in 'Linux' started by knobby67, Mar 3, 2017.

  1. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    392
    Hi,
    calling EditorUtility.OpenFilePanel causes the bottom error, I think this might be a unity error?



    Code (csharp):
    1.  
    2. string path = EditorUtility.OpenFilePanel( "Open Game", "", "xml");
    3.  
    Code (csharp):
    1.  
    2. InvalidOperationException: Operation is not valid due to the current state of the object
    3. System.Collections.Stack.Pop () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Stack.cs:329)
    4. UnityEngine.GUILayoutUtility.EndLayoutGroup () (at /home/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:321)
    5. UnityEngine.GUILayout.EndVertical () (at /home/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:317)
    6. UnityEditor.EditorGUILayout.EndVertical () (at /home/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7300)
    7. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /home/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1250)
    8. UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at /home/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1024)
    9. UnityEditor.InspectorWindow.OnGUI () (at /home/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:359)
    10. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    11.  
     
  2. CrabSchell

    CrabSchell

    Joined:
    May 27, 2014
    Posts:
    9
    I see this too (in 2021.3.27) if I invoke the OpenFilePanel from a custom property drawer. I have a browse button that opens the file panel.