mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
Merge branch 'master' of https://github.com/monitor1394/unity-ugui-XCharts
This commit is contained in:
@@ -22,11 +22,12 @@ namespace XCharts
|
||||
drawRect.height = EditorGUIUtility.singleLineHeight;
|
||||
|
||||
SerializedProperty m_Enable = prop.FindPropertyRelative("m_Enable");
|
||||
SerializedProperty m_Easting = prop.FindPropertyRelative("m_Easting");
|
||||
SerializedProperty m_Duration = prop.FindPropertyRelative("m_Duration");
|
||||
SerializedProperty m_UpdateAnimation = prop.FindPropertyRelative("m_UpdateAnimation");
|
||||
SerializedProperty m_UpdateDuration = prop.FindPropertyRelative("m_UpdateDuration");
|
||||
SerializedProperty m_Delay = prop.FindPropertyRelative("m_Delay");
|
||||
//SerializedProperty m_Easting = prop.FindPropertyRelative("m_Easting");
|
||||
SerializedProperty m_FadeInDuration = prop.FindPropertyRelative("m_FadeInDuration");
|
||||
SerializedProperty m_FadeOutDuration = prop.FindPropertyRelative("m_FadeOutDuration");
|
||||
SerializedProperty m_DataChangeEnable = prop.FindPropertyRelative("m_DataChangeEnable");
|
||||
SerializedProperty m_DataChangeDuration = prop.FindPropertyRelative("m_DataChangeDuration");
|
||||
SerializedProperty m_FadeInDelay = prop.FindPropertyRelative("m_FadeInDelay");
|
||||
SerializedProperty m_Threshold = prop.FindPropertyRelative("m_Threshold");
|
||||
SerializedProperty m_ActualDuration = prop.FindPropertyRelative("m_ActualDuration");
|
||||
// SerializedProperty m_CurrDetailProgress = prop.FindPropertyRelative("m_CurrDetailProgress");
|
||||
@@ -37,23 +38,26 @@ namespace XCharts
|
||||
if (ChartEditorHelper.IsToggle(m_AnimationModuleToggle, prop))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_Easting);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
//EditorGUI.PropertyField(drawRect, m_Easting);
|
||||
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Threshold);
|
||||
if (m_Threshold.intValue < 0) m_Threshold.intValue = 0;
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Delay);
|
||||
if (m_Delay.floatValue < 0) m_Delay.floatValue = 0;
|
||||
EditorGUI.PropertyField(drawRect, m_FadeInDelay);
|
||||
if (m_FadeInDelay.floatValue < 0) m_FadeInDelay.floatValue = 0;
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Duration);
|
||||
if (m_Duration.floatValue < 0) m_Duration.floatValue = 0;
|
||||
EditorGUI.PropertyField(drawRect, m_FadeInDuration);
|
||||
if (m_FadeInDuration.floatValue < 0) m_FadeInDuration.floatValue = 0;
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_UpdateAnimation);
|
||||
EditorGUI.PropertyField(drawRect, m_FadeOutDuration);
|
||||
if (m_FadeOutDuration.floatValue < 0) m_FadeOutDuration.floatValue = 0;
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_UpdateDuration);
|
||||
if (m_UpdateDuration.floatValue < 0) m_UpdateDuration.floatValue = 0;
|
||||
EditorGUI.PropertyField(drawRect, m_DataChangeEnable);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
EditorGUI.PropertyField(drawRect, m_DataChangeDuration);
|
||||
if (m_DataChangeDuration.floatValue < 0) m_DataChangeDuration.floatValue = 0;
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
// EditorGUI.LabelField(drawRect, "CurrDetailProgress:" + m_CurrDetailProgress.floatValue);
|
||||
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
// EditorGUI.LabelField(drawRect, "DestDetailProgress:" + m_DestDetailProgress.floatValue);
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace XCharts
|
||||
public class LegendDrawer : PropertyDrawer
|
||||
{
|
||||
private bool m_DataFoldout = false;
|
||||
private bool m_IconsFoldout = false;
|
||||
private int m_DataSize = 0;
|
||||
private int m_IconsSize = 0;
|
||||
private bool m_ShowJsonDataArea = false;
|
||||
private string m_JsonDataAreaText;
|
||||
private bool m_LegendModuleToggle = false;
|
||||
@@ -30,9 +32,11 @@ namespace XCharts
|
||||
SerializedProperty itemWidth = prop.FindPropertyRelative("m_ItemWidth");
|
||||
SerializedProperty itemHeight = prop.FindPropertyRelative("m_ItemHeight");
|
||||
SerializedProperty itemGap = prop.FindPropertyRelative("m_ItemGap");
|
||||
SerializedProperty itemFontSize = prop.FindPropertyRelative("m_ItemFontSize");
|
||||
SerializedProperty m_ItemAutoColor = prop.FindPropertyRelative("m_ItemAutoColor");
|
||||
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
|
||||
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
|
||||
SerializedProperty m_Icons = prop.FindPropertyRelative("m_Icons");
|
||||
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_LegendModuleToggle, "Legend", show);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -45,7 +49,7 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, itemGap);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, itemFontSize);
|
||||
EditorGUI.PropertyField(drawRect, m_ItemAutoColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_SelectedMode);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -57,12 +61,20 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
drawRect.width = EditorGUIUtility.labelWidth + 10;
|
||||
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Data");
|
||||
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop,pos.width);
|
||||
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop, pos.width);
|
||||
drawRect.width = pos.width;
|
||||
if (m_DataFoldout)
|
||||
{
|
||||
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_Data);
|
||||
}
|
||||
m_IconsFoldout = EditorGUI.Foldout(drawRect, m_IconsFoldout, "Icons");
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_IconsFoldout)
|
||||
{
|
||||
ChartEditorHelper.MakeList(ref drawRect, ref m_IconsSize, m_Icons);
|
||||
}
|
||||
EditorGUI.PropertyField(drawRect, m_TextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -73,7 +85,7 @@ namespace XCharts
|
||||
if (m_LegendModuleToggle)
|
||||
{
|
||||
SerializedProperty location = prop.FindPropertyRelative("m_Location");
|
||||
height += 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(location);
|
||||
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_DataFoldout)
|
||||
@@ -83,6 +95,14 @@ namespace XCharts
|
||||
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
if (m_IconsFoldout)
|
||||
{
|
||||
SerializedProperty m_Icons = prop.FindPropertyRelative("m_Icons");
|
||||
int num = m_Icons.arraySize + 1;
|
||||
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
|
||||
}
|
||||
if (m_ShowJsonDataArea)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace XCharts
|
||||
SerializedProperty m_Radius;
|
||||
SerializedProperty m_SplitNumber;
|
||||
SerializedProperty m_Center;
|
||||
SerializedProperty m_LineStyle;
|
||||
SerializedProperty m_SplitLine;
|
||||
SerializedProperty m_SplitArea;
|
||||
SerializedProperty m_Indicator;
|
||||
SerializedProperty m_IndicatorGap;
|
||||
@@ -39,7 +39,7 @@ namespace XCharts
|
||||
m_Radius = prop.FindPropertyRelative("m_Radius");
|
||||
m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
|
||||
m_Center = prop.FindPropertyRelative("m_Center");
|
||||
m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
|
||||
m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
|
||||
m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
|
||||
m_Indicator = prop.FindPropertyRelative("m_Indicator");
|
||||
m_IndicatorGap = prop.FindPropertyRelative("m_IndicatorGap");
|
||||
@@ -85,8 +85,8 @@ namespace XCharts
|
||||
EditorGUI.PropertyField(drawRect, m_SplitNumber);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
EditorGUI.PropertyField(drawRect, m_LineStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
|
||||
EditorGUI.PropertyField(drawRect, m_SplitLine);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
|
||||
EditorGUI.PropertyField(drawRect, m_SplitArea);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitArea);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -112,7 +112,7 @@ namespace XCharts
|
||||
propNum += 7;
|
||||
if (m_IndicatorJsonAreaToggle) propNum += 4;
|
||||
float height = propNum * EditorGUIUtility.singleLineHeight + (propNum - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitLine"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitArea"));
|
||||
|
||||
if (ChartEditorHelper.IsToggle(m_IndicatorToggle, prop))
|
||||
|
||||
@@ -194,6 +194,8 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Symbol);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
|
||||
EditorGUI.PropertyField(drawRect, m_LineStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
|
||||
EditorGUI.PropertyField(drawRect, m_AreaStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_AreaStyle);
|
||||
break;
|
||||
@@ -451,6 +453,7 @@ namespace XCharts
|
||||
case SerieType.Radar:
|
||||
height += 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
|
||||
|
||||
@@ -14,49 +14,57 @@ namespace XCharts
|
||||
[CustomPropertyDrawer(typeof(TextStyle), true)]
|
||||
public class TextStyleDrawer : PropertyDrawer
|
||||
{
|
||||
//private Dictionary<string, bool> m_TextStyleToggle = new Dictionary<string, bool>();
|
||||
private Dictionary<string, bool> m_TextStyleToggle = new Dictionary<string, bool>();
|
||||
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
Rect drawRect = pos;
|
||||
drawRect.height = EditorGUIUtility.singleLineHeight;
|
||||
SerializedProperty m_Font = prop.FindPropertyRelative("m_Font");
|
||||
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
|
||||
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
|
||||
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
|
||||
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
|
||||
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
|
||||
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
|
||||
// ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TextStyleToggle, prop, "Text Style");
|
||||
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
// if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
|
||||
// {
|
||||
// ++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_Rotate);
|
||||
SerializedProperty m_LineSpacing = prop.FindPropertyRelative("m_LineSpacing");
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TextStyleToggle, prop, null,null,false);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Offset);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
|
||||
EditorGUI.PropertyField(drawRect, m_Color);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontSize);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontStyle);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
// --EditorGUI.indentLevel;
|
||||
// }
|
||||
if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_Font);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Rotate);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_Offset);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
|
||||
EditorGUI.PropertyField(drawRect, m_Color);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontSize);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontStyle);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_LineSpacing);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
// float height = 0;
|
||||
// if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
|
||||
// {
|
||||
// height += 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
|
||||
// }
|
||||
float height = 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
|
||||
float height = 0;
|
||||
if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
|
||||
{
|
||||
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
|
||||
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
|
||||
}
|
||||
else
|
||||
{
|
||||
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
return height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,19 +34,16 @@ namespace XCharts
|
||||
{
|
||||
EditorGUI.PropertyField(drawRect, text);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_TextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
|
||||
--EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, subText);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_SubTextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_SubTextStyle);
|
||||
--EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_ItemGap, new GUIContent("Item Gap"));
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, location);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(location);
|
||||
EditorGUI.PropertyField(drawRect, m_TextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
|
||||
EditorGUI.PropertyField(drawRect, m_SubTextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_SubTextStyle);
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -28,13 +28,12 @@ namespace XCharts
|
||||
SerializedProperty m_FixedHeight = prop.FindPropertyRelative("m_FixedHeight");
|
||||
SerializedProperty m_MinWidth = prop.FindPropertyRelative("m_MinWidth");
|
||||
SerializedProperty m_MinHeight = prop.FindPropertyRelative("m_MinHeight");
|
||||
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
|
||||
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
|
||||
SerializedProperty m_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
|
||||
SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight");
|
||||
SerializedProperty m_PaddingTopBottom = prop.FindPropertyRelative("m_PaddingTopBottom");
|
||||
SerializedProperty m_BackgroundImage = prop.FindPropertyRelative("m_BackgroundImage");
|
||||
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
|
||||
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -61,16 +60,14 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_PaddingTopBottom);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontSize);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_FontStyle);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_BackgroundImage);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_ForceENotation);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_LineStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
|
||||
EditorGUI.PropertyField(drawRect, m_TextStyle);
|
||||
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
@@ -78,8 +75,9 @@ namespace XCharts
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
if (m_TooltipModuleToggle)
|
||||
return 15 * EditorGUIUtility.singleLineHeight + 14 * EditorGUIUtility.standardVerticalSpacing +
|
||||
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
|
||||
return 13 * EditorGUIUtility.singleLineHeight + 12 * EditorGUIUtility.standardVerticalSpacing +
|
||||
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle")) +
|
||||
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
|
||||
else
|
||||
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
@@ -28,6 +29,10 @@ namespace XCharts
|
||||
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
|
||||
canvasObject.AddComponent<CanvasScaler>();
|
||||
canvasObject.AddComponent<GraphicRaycaster>();
|
||||
var eventSystem = new GameObject();
|
||||
eventSystem.name = "EventSystem";
|
||||
eventSystem.AddComponent<EventSystem>();
|
||||
eventSystem.AddComponent<StandaloneInputModule>();
|
||||
return canvas.transform;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user