public void SetData(string path, Encoding encoding)
        {
            FileInfo fileInfo = new FileInfo(path);

            // Instance = DataTableEditingWindow.CreateWindow<DataTableEditingWindow>(fileInfo.Name);
#if UNITY_2019_1_OR_NEWER
            Instance = LauncherEditorWindow.CreateWindow <DataTableEditingWindow>(fileInfo.Name);
#else
            Instance = EditorWindowUtility.CreateWindow <DataTableEditingWindow>(fileInfo.Name);
#endif
            Instance.OpenWindow(path, encoding);
            Instance.Show();
        }
Exemplo n.º 2
0
        public static void OpenWindow(string path)
        {
            FilePath = path;
            RowDatas = DataTableUtility.LoadDataTableFile(FilePath);

            if (RowDatas == null)
            {
                return;
            }

            RowDatasTemp = new List <DataTableRowData>();

            for (int i = 0; i < RowDatas.Count; i++)
            {
                DataTableRowData data = new DataTableRowData();

                for (int j = 0; j < RowDatas[i].Data.Count; j++)
                {
                    data.Data.Add(RowDatas[i].Data[j]);
                }

                RowDatasTemp.Add(data);
            }

            if (RowDatas == null)
            {
                return;
            }

            FileInfo fileInfo = new FileInfo(path);

            Instance = DataTableEditingWindow.CreateWindow <DataTableEditingWindow>(fileInfo.Name);
            Instance.Show();

            LightMode = EditorPrefs.GetInt("DataTableEditor_" + Application.productName + "_LightMode", 0);
        }
Exemplo n.º 3
0
 private void ButtonLoad()
 {
     DataTableEditingWindow.OpenWindow(EditorUtility.OpenFilePanel("加载数据表格文件", "", "txt"));
     this.Close();
 }
Exemplo n.º 4
0
 private void ButtonNew()
 {
     DataTableEditingWindow.OpenWindow(DataTableUtility.NewDataTableFile());
     this.Close();
 }