mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
Removed settings for TextMeshPro when package first imported
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2021.10.29) Removed settings for `TextMeshPro` when package first imported
|
||||
* (2021.10.29) Added support for `{e}` in `Tooltip` #170
|
||||
* (2021.09.08) Improved `RadarChart`
|
||||
* (2021.09.07) Fixed bug where `label` does not disappear at the end of `PieChart` fade animation #168
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
## master
|
||||
|
||||
* (2021.10.29) 移除`XCharts`首次导入时`TextMeshPro`的相关设置
|
||||
* (2021.10.29) 增加`Tooltip`对通配符`{e}`的支持 #170
|
||||
* (2021.09.08) 完善`RadarChart`
|
||||
* (2021.09.07) 修复`PieChart`渐出动画结束时`label`没有消失的问题 #168
|
||||
|
||||
@@ -34,10 +34,14 @@ namespace XCharts
|
||||
GUI.enabled = !m_EssentialResourcesImported;
|
||||
if (GUILayout.Button("Import XCharts Essentials"))
|
||||
{
|
||||
AssetDatabase.importPackageCompleted += ImportCallback;
|
||||
|
||||
string packageFullPath = GetPackageFullPath();
|
||||
AssetDatabase.ImportPackage(packageFullPath + "/Package Resources/XCharts Essential Resources.unitypackage", false);
|
||||
var sourPath = Path.Combine(packageFullPath, "Resources");
|
||||
var destPath = Path.Combine(Application.dataPath, "XCharts/Resources");
|
||||
if (CopyFolder(sourPath, destPath))
|
||||
{
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
GUILayout.Space(5f);
|
||||
GUI.enabled = true;
|
||||
@@ -45,35 +49,40 @@ namespace XCharts
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.BeginVertical();
|
||||
{
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
{
|
||||
GUILayout.Label("TextMeshPro", EditorStyles.boldLabel);
|
||||
#if dUI_TextMeshPro
|
||||
GUILayout.Label("TextMeshPro is now enabled. You can turn it off by clicking the button below.", new GUIStyle(EditorStyles.label) { wordWrap = true });
|
||||
GUILayout.Space(5f);
|
||||
if (GUILayout.Button("Disable TextMeshPro"))
|
||||
{
|
||||
XChartsMgr.DisableTextMeshPro();
|
||||
}
|
||||
#else
|
||||
GUILayout.Label("TextMeshPro is not active. You can activate it by clicking the button below. Make sure TextMeshPro is already in your project before activating it.", new GUIStyle(EditorStyles.label) { wordWrap = true });
|
||||
GUILayout.Space(5f);
|
||||
if (GUILayout.Button("Enable TextMeshPro"))
|
||||
{
|
||||
XChartsMgr.EnableTextMeshPro();
|
||||
}
|
||||
#endif
|
||||
GUILayout.Space(5f);
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user