85 lines
2.4 KiB
C#
85 lines
2.4 KiB
C#
using Sirenix.Utilities.Editor;
|
|
using System;
|
|
using UnityEngine;
|
|
using Sirenix.OdinInspector.Editor;
|
|
using Sirenix.OdinInspector;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using UnityEditor;
|
|
using DLLComplierEditor;
|
|
using Thousandto.Package;
|
|
|
|
namespace Thousandto.DaleSpeace
|
|
{
|
|
public class GuideTable : EditorWindow
|
|
{
|
|
List<string> ConfigVer = new List<string>();
|
|
|
|
public GuideTable()
|
|
{
|
|
var basePath = "../../Gamedata";
|
|
if (Directory.Exists(basePath))
|
|
{
|
|
DirectoryInfo theFolder = new DirectoryInfo(basePath);
|
|
DirectoryInfo[] files = theFolder.GetDirectories();
|
|
foreach (var item in files)
|
|
{
|
|
if (item.Name.IndexOf("Config") == -1)
|
|
continue;
|
|
ConfigVer.Add(item.Name);
|
|
}
|
|
}
|
|
}
|
|
|
|
[DetailedInfoBox("----点击查看使用详情----", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ")]
|
|
[ShowInInspector, DisplayAsString, PropertyOrder(-1)]
|
|
public string CurrentTime
|
|
{
|
|
get
|
|
{
|
|
GUIHelper.RequestRepaint();
|
|
return DateTime.Now.ToString();
|
|
}
|
|
}
|
|
|
|
[BoxGroup("选择配置的对应版本", true, false, 0)]
|
|
[ValueDropdown("ConfigVer")]
|
|
public string ConfigVers = "Config";
|
|
|
|
|
|
[HorizontalGroup("one")]
|
|
[Button("普通导表", 30)]
|
|
private void Guide()
|
|
{
|
|
Main.ExecuteCfg(BuildTarget.Android, string.Empty, string.Empty);
|
|
}
|
|
|
|
[GUIColor(1f, 0.2f, 0.08f)]
|
|
[HorizontalGroup("one")]
|
|
[Button("快速导表", 30)]
|
|
private void QuickGuide()
|
|
{
|
|
Main.ExecuteCfg(BuildTarget.Android, string.Empty, string.Empty, false, true);
|
|
}
|
|
|
|
[GUIColor(0.3f, 0.6f, 0.4f)]
|
|
[HorizontalGroup("one")]
|
|
[Button("单张导表", 30)]
|
|
private void GuideOne()
|
|
{
|
|
var selectPath = EditorUtility.OpenFilePanel("选择导出的配置表", "", "*");
|
|
if (!string.IsNullOrEmpty(selectPath))
|
|
{
|
|
if (!selectPath.EndsWith(".xlsx"))
|
|
{
|
|
Debug.LogError("请选择正确的.xlsx文件");
|
|
return;
|
|
}
|
|
Main.ExecuteSingleCfg(selectPath);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|