Ejemplo n.º 1
0
        public static void ShowWindow()
        {
            //创建窗口
            ToolsCenter window = (ToolsCenter)EditorWindow.GetWindow(typeof(ToolsCenter), true, "ToolsCenter");

            window.Show();

            string path = CustomDataUtil.GetVal("ExcelPath");

            if (path != null)
            {
                window.excelPath = path;
            }

            string dir = CustomDataUtil.GetVal("ExcelDir");

            if (dir != null)
            {
                window.excelDir = dir;
            }

            string paths = CustomDataUtil.GetVal("AutoExcelPaths");

            window.assetList = new List <ScriptableObject>();
            if (paths != null && paths.Length > 0)
            {
                string[] pathArray = paths.Split('@');
                for (int i = 0; i < pathArray.Length; i++)
                {
                    ScriptableObject sobj = Resources.Load <ScriptableObject>(pathArray[i]);
                    if (sobj != null)
                    {
                        window.assetList.Add(sobj);
                    }
                }
            }
        }