mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
3.0
This commit is contained in:
@@ -13,6 +13,7 @@ namespace XCharts.Runtime
|
||||
public virtual bool useDataNameForColor { get { return false; } }
|
||||
public virtual bool titleJustForSerie { get { return false; } }
|
||||
public virtual bool useSortData { get { return false; } }
|
||||
public virtual bool multiDimensionLabel { get { return false; } }
|
||||
public bool anyDirty { get { return vertsDirty || componentDirty; } }
|
||||
public Painter painter { get { return m_Painter; } set { m_Painter = value; } }
|
||||
public Action refreshComponent { get; set; }
|
||||
|
||||
@@ -14,8 +14,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public XCResourcesImporter() { }
|
||||
|
||||
public void OnDestroy()
|
||||
{ }
|
||||
public void OnDestroy() { }
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
@@ -38,7 +37,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var sourPath = Path.Combine(packageFullPath, "Resources");
|
||||
var destPath = Path.Combine(Application.dataPath, "XCharts/Resources");
|
||||
if (RuntimeUtil.CopyFolder(sourPath, destPath))
|
||||
if (CopyFolder(sourPath, destPath))
|
||||
{
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
@@ -54,6 +53,37 @@ namespace XCharts.Runtime
|
||||
GUILayout.Space(5f);
|
||||
}
|
||||
|
||||
private static bool CopyFolder(string sourPath, string destPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(destPath))
|
||||
{
|
||||
Directory.CreateDirectory(destPath);
|
||||
}
|
||||
var files = Directory.GetFiles(sourPath);
|
||||
foreach (var file in files)
|
||||
{
|
||||
var name = Path.GetFileName(file);
|
||||
var path = Path.Combine(destPath, name);
|
||||
File.Copy(file, path);
|
||||
}
|
||||
var folders = Directory.GetDirectories(sourPath);
|
||||
foreach (var folder in folders)
|
||||
{
|
||||
var name = Path.GetFileName(folder);
|
||||
var path = Path.Combine(destPath, name);
|
||||
CopyFolder(folder, path);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("CopyFolder:" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void RegisterResourceImportCallback()
|
||||
{
|
||||
AssetDatabase.importPackageCompleted += ImportCallback;
|
||||
|
||||
@@ -154,6 +154,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static bool ExistAssetFile()
|
||||
{
|
||||
return System.IO.File.Exists("Assets/XCharts/Resources/XCSettings.asset");
|
||||
@@ -184,6 +185,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
return null;
|
||||
}
|
||||
#endif
|
||||
|
||||
public static bool AddCustomTheme(Theme theme)
|
||||
{
|
||||
|
||||
@@ -126,6 +126,7 @@ namespace XCharts.Runtime
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static string GetPackageFullPath()
|
||||
{
|
||||
string packagePath = Path.GetFullPath("Packages/com.monitor1394.xcharts");
|
||||
@@ -167,8 +168,6 @@ namespace XCharts.Runtime
|
||||
return null;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
[UnityEditor.Callbacks.DidReloadScripts]
|
||||
static void OnEditorReload()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user