private bool Init() { sceneConfigPath = Application.dataPath + "/" + sceneConfigPath; Scene curScene = SceneManager.GetActiveScene(); if (curScene == null) { window.Close(); window = null; UnityEditor.EditorUtility.DisplayDialog("Title", "请先打开场景", "是"); return(false); } m_sceneName = curScene.name; LoadGroups(); string configPath = SceneTools.getConfigPath(); try { baseItemsData.Clear(); System.Reflection.PropertyInfo[] proInfo; ConfHelper.LoadFromExcel <BaseItem>(configPath + "exhibit.xlsx", 0, out baseItemsData, out proInfo); } catch (IOException ex) { window.Close(); window = null; UnityEditor.EditorUtility.DisplayDialog("Title", "先关表!!!", "是"); return(false); } return(true); }
static void CreateWindow() { Rect rect = new Rect(0, 0, 500, 300); window = (SceneFilterWindow)EditorWindow.GetWindowWithRect(typeof(SceneFilterWindow), rect, true, "场景物件展示"); if (window.Init()) { window.Show(); } }