优化Theme

This commit is contained in:
monitor1394
2021-04-01 12:13:51 +08:00
parent eda93f0776
commit 3810082cec
3 changed files with 6 additions and 2 deletions

View File

@@ -25,6 +25,8 @@ namespace XCharts
{
if (!IsThemeAsset(assetPath)) return;
var obj = AssetDatabase.LoadAssetAtPath<TextAsset>(assetPath);
if (obj == null || obj.text == null) return;
if (!obj.text.Contains("m_Theme")) return;
if (XChartsSettings.AddJsonTheme(obj))
{
XThemeMgr.ReloadThemeList();
@@ -54,6 +56,7 @@ namespace XCharts
private static bool IsThemeAsset(string assetPath)
{
if (!assetPath.EndsWith(".json")) return false;
if (!assetPath.StartsWith("XTheme")) return false;
return true;
}
}