mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 17:30:10 +00:00
优化Theme
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user