mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
3.0
This commit is contained in:
@@ -21,7 +21,8 @@ namespace XCharts.Runtime
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
m_EssentialResourcesImported = File.Exists("Assets/XCharts/Resources/XCSettings.asset");
|
||||
m_EssentialResourcesImported = Resources.Load<XCSettings>("XCSettings") != null ||
|
||||
XCSettings.ExistAssetFile();
|
||||
|
||||
GUILayout.BeginVertical();
|
||||
{
|
||||
@@ -125,17 +126,17 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public class XChartsPackageResourceImporterWindow : UnityEditor.EditorWindow
|
||||
public class XCResourceImporterWindow : UnityEditor.EditorWindow
|
||||
{
|
||||
[SerializeField] XCResourcesImporter m_ResourceImporter;
|
||||
|
||||
static XChartsPackageResourceImporterWindow m_ImporterWindow;
|
||||
static XCResourceImporterWindow m_ImporterWindow;
|
||||
|
||||
public static void ShowPackageImporterWindow()
|
||||
{
|
||||
if (m_ImporterWindow == null)
|
||||
{
|
||||
m_ImporterWindow = GetWindow<XChartsPackageResourceImporterWindow>();
|
||||
m_ImporterWindow = GetWindow<XCResourceImporterWindow>();
|
||||
m_ImporterWindow.titleContent = new GUIContent("XCharts Importer");
|
||||
}
|
||||
|
||||
|
||||
@@ -129,9 +129,8 @@ namespace XCharts.Runtime
|
||||
#if UNITY_EDITOR
|
||||
if (s_Instance == null)
|
||||
{
|
||||
var isExist = System.IO.File.Exists("Assets/XCharts/Resources/XCSettings.asset");
|
||||
if(isExist)
|
||||
XChartsPackageResourceImporterWindow.ShowPackageImporterWindow();
|
||||
if (!ExistAssetFile())
|
||||
XCResourceImporterWindow.ShowPackageImporterWindow();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -152,6 +151,11 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ExistAssetFile()
|
||||
{
|
||||
return System.IO.File.Exists("Assets/XCharts/Resources/XCSettings.asset");
|
||||
}
|
||||
|
||||
public static bool AddCustomTheme(Theme theme)
|
||||
{
|
||||
if (theme == null) return false;
|
||||
|
||||
@@ -86,33 +86,6 @@ namespace XCharts.Runtime
|
||||
return chartList.Contains(chart);
|
||||
}
|
||||
|
||||
public static bool IsRepeatChartName(BaseChart chart, string chartName = null)
|
||||
{
|
||||
if (chartName == null)
|
||||
chartName = chart.chartName;
|
||||
if (string.IsNullOrEmpty(chartName))
|
||||
return false;
|
||||
foreach (var temp in chartList)
|
||||
{
|
||||
if (temp != chart && chartName.Equals(temp.chartName))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetRepeatChartNameInfo(BaseChart chart, string chartName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(chartName))
|
||||
return string.Empty;
|
||||
string result = "";
|
||||
foreach (var temp in chartList)
|
||||
{
|
||||
if (temp != chart && chartName.Equals(temp.chartName))
|
||||
result += ChartHelper.GetFullName(temp.transform) + "\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void RemoveAllChartObject()
|
||||
{
|
||||
if (chartList.Count == 0)
|
||||
|
||||
Reference in New Issue
Block a user