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; 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 = (PickUpLighting)EditorWindow.GetWindowWithRect(typeof(PickUpLighting), rect, true, "场景编辑器"); if (window.Init()) { window.Show(); } }