v2.0.0-preview.1

This commit is contained in:
monitor1394
2021-01-19 12:39:12 +08:00
parent b7ca0ac531
commit 68da7221b8
8 changed files with 36 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2021.01.19) Release `v2.0.0-preview.1` version
* (2021.01.02) Release `v1.6.3` version
* (2020.12.18) fixed an issue where updating data when `Animation` was not enabled caused the chart to keep refreshing
* (2020.12.01) fixed an issue where a newly created chart on `Unity2020` could not be drawn properly

View File

@@ -1,6 +1,7 @@
# 更新日志
* (2021.01.19) 发布`v2.0.0-preview.1`版本
* (2021.01.02) 发布`v1.6.3`版本
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题
* (2020.12.01) 修复`Unity2020`上新创建的图表无法正常绘制的问题

View File

@@ -18,6 +18,11 @@ namespace XCharts
[CustomEditor(typeof(BaseChart), false)]
public class BaseChartEditor : Editor
{
private const float k_IconWidth = 14;
private const float k_IconGap = 0f;
private const float k_IconXOffset = 10f;
private const float k_IconYOffset = -5f;
protected BaseChart m_Chart;
protected SerializedProperty m_Script;
protected SerializedProperty m_MultiComponentMode;
@@ -191,32 +196,32 @@ namespace XCharts
prop.arraySize = EditorGUILayout.IntField("Size", prop.arraySize);
for (int i = 0; i < prop.arraySize; i++)
{
SerializedProperty element = prop.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(prop.GetArrayElementAtIndex(i), true);
EditorGUILayout.Space(-EditorGUIUtility.singleLineHeight - EditorGUIUtility.standardVerticalSpacing);
var currRect = EditorGUILayout.GetControlRect();
var iconWidth = 14;
var iconGap = 0f;
var xDiff = 10f;
var yDiff = 3f;
var rect1 = new Rect(currRect.width + xDiff, currRect.y + yDiff,
iconWidth, EditorGUIUtility.singleLineHeight);
var rect1 = new Rect(currRect.width + k_IconXOffset,
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect1, ChartEditorHelper.Styles.iconRemove, ChartEditorHelper.Styles.invisibleButton))
{
if (i < prop.arraySize && i >= 0) prop.DeleteArrayElementAtIndex(i);
}
var rect2 = new Rect(currRect.width + xDiff - iconWidth - iconGap, currRect.y + yDiff,
iconWidth, EditorGUIUtility.singleLineHeight);
var rect2 = new Rect(currRect.width + k_IconXOffset - k_IconWidth - k_IconGap,
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect2, ChartEditorHelper.Styles.iconDown, ChartEditorHelper.Styles.invisibleButton))
{
if (i < prop.arraySize - 1) prop.MoveArrayElement(i, i + 1);
}
var rect3 = new Rect(currRect.width + xDiff - 2 * (iconWidth + iconGap), currRect.y + yDiff,
iconWidth, EditorGUIUtility.singleLineHeight);
var rect3 = new Rect(currRect.width + k_IconXOffset - 2 * (k_IconWidth + k_IconGap),
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect3, ChartEditorHelper.Styles.iconUp, ChartEditorHelper.Styles.invisibleButton))
{
if (i > 0) prop.MoveArrayElement(i, i - 1);
}
EditorGUILayout.Space(-EditorGUIUtility.singleLineHeight - EditorGUIUtility.standardVerticalSpacing);
EditorGUILayout.PropertyField(element, true);
}
EditorGUI.indentLevel--;
}

View File

@@ -141,6 +141,11 @@ The following is the relationship structure of LineChart:
* See more examples of code dynamic control: [Tutorial - Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md).
* Enable TextMeshPro:
1. `XCharts -> TextMeshPro Enable` or `Project Setting -> XCharts -> Enable TextMeshPro`
2. `Project Setting -> XCharts -> Settings -> TMP Font` set the TextMeshPro font.
3. If the chart does not initialize properly, you can use the `Remove All Chart Object` button to clean up the chart and reinitialize it.
## Documents
* [XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)

View File

@@ -7,7 +7,7 @@
namespace XCharts
{
public partial class PolarChart
public partial class BaseChart
{
/// <summary>
/// 极坐标。

View File

@@ -35,11 +35,11 @@ namespace XCharts
[ExecuteInEditMode]
public class XChartsMgr : MonoBehaviour
{
internal static string _version = "2.0.0";
internal static int _versionDate = 20210117;
internal static string _version = "2.0.0-preview.1";
internal static int _versionDate = 20210119;
public static string version { get { return _version; } }
public static int versionDate { get { return _versionDate; } }
public static string fullVersion { get { return version + "_" + versionDate; } }
public static string fullVersion { get { return version + "-" + versionDate; } }
[SerializeField] private string m_NowVersion;
[SerializeField] private string m_NewVersion;
@@ -173,7 +173,7 @@ namespace XCharts
{
isNetworkError = false;
var cv = JsonUtility.FromJson<XChartsVersion>(web.downloadHandler.text);
m_NewVersion = cv.version + "_" + cv.date;
m_NewVersion = cv.version + "-" + cv.date;
newDate = cv.date;
newCheckDate = cv.checkdate;
desc = cv.desc;

View File

@@ -1,9 +1,9 @@
{
"name": "com.monitor1394.xcharts",
"displayName": "XCharts",
"version": "2.0.0",
"date": "20210117",
"checkdate": "20210117",
"version": "2.0.0-preview.1",
"date": "20210119",
"checkdate": "20210119",
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
"unity": "2018.3",
"description": "A charting and data visualization library for Unity.",

View File

@@ -1,7 +1,7 @@
{
"version": "2.0.0",
"date": "20210117",
"checkdate": "20210117",
"version": "2.0.0-preview.1",
"date": "20210119",
"checkdate": "20210119",
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
"homepage": "https://github.com/monitor1394/unity-ugui-XCharts"
}