Skip to content

Commit cbda1c1

Browse files
committed
update XCharts to v3.1.0
1 parent d8ec82a commit cbda1c1

File tree

176 files changed

+232429
-871310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+232429
-871310
lines changed

Assets/Editor/ChartUpdate.cs

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
2-
using UnityEngine;
3-
using UnityEditor;
41
using System.IO;
2+
using UnityEditor;
3+
using UnityEngine;
54
using XCharts.Runtime;
65

76
public static class ChartUpdate
@@ -33,4 +32,25 @@ public static void UpdateTooltip()
3332
AssetDatabase.SaveAssets();
3433
AssetDatabase.Refresh();
3534
}
35+
36+
[MenuItem("Tools/RebuildAllChart")]
37+
public static void RebuildAllChart()
38+
{
39+
var files = new DirectoryInfo(Application.dataPath).GetFiles("*.prefab", SearchOption.AllDirectories);
40+
foreach (var file in files)
41+
{
42+
var index = file.FullName.IndexOf("Assets/");
43+
var assetPath = file.FullName.Substring(index);
44+
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
45+
var chart = prefab.GetComponent<BaseChart>();
46+
if (chart != null)
47+
{
48+
Debug.LogError("file:" + assetPath + "," + chart);
49+
chart.RebuildChartObject();
50+
EditorUtility.SetDirty(prefab);
51+
}
52+
}
53+
AssetDatabase.SaveAssets();
54+
AssetDatabase.Refresh();
55+
}
3656
}

0 commit comments

Comments
 (0)