优化自定义主题Theme的自动刷新 (#148)

This commit is contained in:
monitor1394
2021-06-05 09:56:00 +08:00
parent 7b7150b87f
commit d6a024026b
4 changed files with 17 additions and 0 deletions

View File

@@ -94,6 +94,14 @@ namespace XCharts
newtheme.theme = Theme.Custom;
newtheme.themeName = themeNewName;
if (!Directory.Exists(Application.dataPath + "/XCharts"))
{
Directory.CreateDirectory(Application.dataPath + "/XCharts");
}
if (!Directory.Exists(Application.dataPath + "/XCharts/Resources"))
{
Directory.CreateDirectory(Application.dataPath + "/XCharts/Resources");
}
var themeFileName = "XTheme-" + newtheme.themeName;
var assetPath = string.Format("Assets/XCharts/Resources/{0}", themeFileName);
var filePath = string.Format("{0}/../{1}.json", Application.dataPath, assetPath);