Skip to content

Commit

Permalink
update XCharts to v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Jul 12, 2022
1 parent d8ec82a commit cbda1c1
Show file tree
Hide file tree
Showing 176 changed files with 232,429 additions and 871,310 deletions.
26 changes: 23 additions & 3 deletions Assets/Editor/ChartUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

using UnityEngine;
using UnityEditor;
using System.IO;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

public static class ChartUpdate
Expand Down Expand Up @@ -33,4 +32,25 @@ public static void UpdateTooltip()
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}

[MenuItem("Tools/RebuildAllChart")]
public static void RebuildAllChart()
{
var files = new DirectoryInfo(Application.dataPath).GetFiles("*.prefab", SearchOption.AllDirectories);
foreach (var file in files)
{
var index = file.FullName.IndexOf("Assets/");
var assetPath = file.FullName.Substring(index);
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
var chart = prefab.GetComponent<BaseChart>();
if (chart != null)
{
Debug.LogError("file:" + assetPath + "," + chart);
chart.RebuildChartObject();
EditorUtility.SetDirty(prefab);
}
}
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
}
Loading

0 comments on commit cbda1c1

Please sign in to comment.