mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
优化主题Theme的导入和字体自动刷新 (#148)
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
using UnityEngine;
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -63,7 +70,8 @@ namespace XCharts
|
||||
private static bool IsThemeAsset(string assetPath)
|
||||
{
|
||||
if (!assetPath.EndsWith(".json")) return false;
|
||||
if (!assetPath.StartsWith("XTheme")) return false;
|
||||
var assetName = Path.GetFileNameWithoutExtension(assetPath);
|
||||
if (!assetName.StartsWith(XChartsSettings.THEME_ASSET_NAME_PREFIX)) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
28
Editor/Utility/XChartsBuild.cs
Normal file
28
Editor/Utility/XChartsBuild.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
public class XChartsBuild : IPreprocessBuild, IPostprocessBuild
|
||||
{
|
||||
public int callbackOrder => 1;
|
||||
|
||||
public void OnPostprocessBuild(BuildTarget target, string path)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnPreprocessBuild(BuildTarget target, string path)
|
||||
{
|
||||
XThemeMgr.ExportAllCustomTheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/Utility/XChartsBuild.cs.meta
Normal file
11
Editor/Utility/XChartsBuild.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df212e63c528e40fa9e8fffcd868ab7d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user