unity editor gui 依靠抛出异常退出某些ui逻辑,因为不要捕获改异常,正确做法如下:
try
{
editor.OnInspectorGUI();
}
catch(UnityEngine.ExitGUIException )
{
throw;
}
catch(Exception e)
{
GUILayout.Label("载入自定义面板失败,将以内建面板显示");
editor.DrawDefaultInspector();
Debug.LogException(e);
}