mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
修复Unity版本兼容问题
This commit is contained in:
@@ -197,7 +197,7 @@ namespace XCharts
|
||||
for (int i = 0; i < prop.arraySize; i++)
|
||||
{
|
||||
EditorGUILayout.PropertyField(prop.GetArrayElementAtIndex(i), true);
|
||||
EditorGUILayout.Space(-EditorGUIUtility.singleLineHeight - EditorGUIUtility.standardVerticalSpacing);
|
||||
EditorGUILayout.Space();
|
||||
var currRect = EditorGUILayout.GetControlRect();
|
||||
|
||||
var rect1 = new Rect(currRect.width + k_IconXOffset,
|
||||
|
||||
@@ -165,13 +165,13 @@ namespace XCharts
|
||||
else if (IsAssetsExist(XChartsMgr.GetThemeAssetPath(m_ChartName)))
|
||||
{
|
||||
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath="
|
||||
+ XChartsMgr.GetThemeAssetPath(m_ChartName)), 5);
|
||||
+ XChartsMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
else
|
||||
{
|
||||
XChartsMgr.ExportTheme(target.theme, m_ChartName);
|
||||
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath="
|
||||
+ XChartsMgr.GetThemeAssetPath(m_ChartName)), 5);
|
||||
+ XChartsMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public class ChartEditorHelper
|
||||
public const float INDENT_WIDTH = 15;
|
||||
public const float BOOL_WIDTH = 15;
|
||||
public const float ARROW_WIDTH = 13;
|
||||
public const float BLOCK_WIDTH = 0;
|
||||
public const float GAP_WIDTH = 0;
|
||||
#endif
|
||||
|
||||
@@ -26,8 +27,8 @@ public class ChartEditorHelper
|
||||
font = headerStyle.font,
|
||||
fontStyle = headerStyle.fontStyle,
|
||||
};
|
||||
public static readonly GUIContent iconAdd = EditorGUIUtility.TrIconContent("Toolbar Plus", "Add");
|
||||
public static readonly GUIContent iconRemove = EditorGUIUtility.TrIconContent("Toolbar Minus", "Remove");
|
||||
public static readonly GUIContent iconAdd = new GUIContent("+", "Add");
|
||||
public static readonly GUIContent iconRemove = new GUIContent("-", "Remove");
|
||||
public static readonly GUIContent iconUp = new GUIContent("↑", "Up");
|
||||
public static readonly GUIContent iconDown = new GUIContent("↓", "Down");
|
||||
public static readonly GUIStyle invisibleButton = "InvisibleButton";
|
||||
@@ -286,20 +287,20 @@ public class ChartEditorHelper
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
var listSize = listProp.arraySize;
|
||||
var iconWidth = 14;
|
||||
var iconWidth = 15;
|
||||
var iconGap = 3f;
|
||||
if (showSize)
|
||||
{
|
||||
if (showOrder)
|
||||
{
|
||||
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
|
||||
var elementRect = new Rect(drawRect.x, drawRect.y, drawRect.width - iconWidth - 1, drawRect.height);
|
||||
var elementRect = new Rect(drawRect.x, drawRect.y, drawRect.width - iconWidth + 2, drawRect.height);
|
||||
var iconRect = new Rect(drawRect.width - iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||
if (XChartsSettings.editorBlockEnable)
|
||||
{
|
||||
iconRect.x += BLOCK_WIDTH;
|
||||
}
|
||||
if (GUI.Button(iconRect, Styles.iconAdd, Styles.invisibleButton))
|
||||
if (GUI.Button(iconRect, Styles.iconAdd))
|
||||
{
|
||||
if (listProp.displayName.Equals("Series"))
|
||||
{
|
||||
@@ -361,7 +362,7 @@ public class ChartEditorHelper
|
||||
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
|
||||
var isSerie = "Serie".Equals(element.type);
|
||||
var elementRect = isSerie
|
||||
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH, drawRect.height)
|
||||
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - iconGap, drawRect.height)
|
||||
: new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
|
||||
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
|
||||
var iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
|
||||
@@ -369,7 +370,7 @@ public class ChartEditorHelper
|
||||
{
|
||||
iconRect.x += BLOCK_WIDTH;
|
||||
}
|
||||
if (GUI.Button(iconRect, Styles.iconUp, Styles.invisibleButton))
|
||||
if (GUI.Button(iconRect, Styles.iconUp))
|
||||
{
|
||||
if (i > 0) listProp.MoveArrayElement(i, i - 1);
|
||||
}
|
||||
@@ -378,7 +379,7 @@ public class ChartEditorHelper
|
||||
{
|
||||
iconRect.x += BLOCK_WIDTH;
|
||||
}
|
||||
if (GUI.Button(iconRect, Styles.iconDown, Styles.invisibleButton))
|
||||
if (GUI.Button(iconRect, Styles.iconDown))
|
||||
{
|
||||
if (i < listProp.arraySize - 1) listProp.MoveArrayElement(i, i + 1);
|
||||
}
|
||||
@@ -387,7 +388,7 @@ public class ChartEditorHelper
|
||||
{
|
||||
iconRect.x += BLOCK_WIDTH;
|
||||
}
|
||||
if (GUI.Button(iconRect, Styles.iconRemove, Styles.invisibleButton))
|
||||
if (GUI.Button(iconRect, Styles.iconRemove))
|
||||
{
|
||||
if (i < listProp.arraySize && i >= 0) listProp.DeleteArrayElementAtIndex(i);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"name": "XCharts.Editor",
|
||||
"references": [
|
||||
"XCharts.Runtime",
|
||||
"Unity.TextMeshPro"
|
||||
"XCharts.Runtime"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
|
||||
@@ -38,6 +38,7 @@ MonoBehaviour:
|
||||
m_SerieScatterSymbolSize: 20
|
||||
m_SerieScatterSymbolSelectedSize: 30
|
||||
m_EditorBlockEnable: 1
|
||||
m_EditorShowAllListData: 0
|
||||
m_MaxPainter: 10
|
||||
m_LineSmoothStyle: 3
|
||||
m_LineSmoothness: 2
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "XCharts.Runtime",
|
||||
"references": [
|
||||
"Unity.TextMeshPro"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [],
|
||||
|
||||
@@ -14,7 +14,10 @@ using TMPro;
|
||||
namespace XCharts
|
||||
{
|
||||
[Serializable]
|
||||
#if UNITY_2018_3
|
||||
|
||||
[ExcludeFromPresetAttribute]
|
||||
#endif
|
||||
public class XChartsSettings : ScriptableObject
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user