Exemplo n.º 1
0
        public static ExcelItem CreateItem(string path)
        {
            if (mItemTreeAsset == null)
            {
                MessageBox.Error("ExcelItem描述文件null");
                return(null);
            }
            var root = mItemTreeAsset.CloneTree();
            var item = new ExcelItem(path, root);

            item.Init();

            return(item);
        }
Exemplo n.º 2
0
        private void DecodeExcel(int index)
        {
            if (mItems.Count == 0 || mItems.Count <= index)
            {
                if (mItems.Count <= index)
                {
                    EditorUtility.DisplayDialog("完 成", "所有配置表已经解析完成并导出为二进制文件!", "确定");
                }
                return;
            }
            ExcelItem item = mItems[index];

            item.Decode(() => {
                int i = index + 1;
                DecodeExcel(i);
            });
        }
Exemplo n.º 3
0
        private void DrawUI()
        {
            VisualElement visualRoot = mVisualTree.CloneTree().Q <ScrollView>("excelSV");

            mRoot.Add(visualRoot);

            if (mExcelNames.Length > 0)
            {
                ExcelItem.GetRoot();
                for (int i = 0; i < mExcelNames.Length; i++)
                {
                    var path = mExcelNames[i];
                    if (string.IsNullOrEmpty(path))
                    {
                        MessageBox.Error("Excel 路径为 null. " + i.ToString());
                        continue;
                    }
                    var item = ExcelItem.CreateItem(path);
                    item.AddStyle(mUss);
                    item.SetParent(visualRoot);
                    mItems.Add(item);
                }
            }
        }