Tooltip增加crossLabel显示十字准星指示器

This commit is contained in:
monitor1394
2019-05-29 09:53:30 +08:00
parent cdfef09129
commit 45f23b0927
13 changed files with 7534 additions and 3010 deletions

View File

@@ -14,13 +14,23 @@ namespace XCharts
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty crossLabel = prop.FindPropertyRelative("m_CrossLabel");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_TooltipModuleToggle)
{
EditorGUI.PropertyField(drawRect, crossLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
return 1 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
if(m_TooltipModuleToggle)
return 2 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
else
return 1 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
}
}
}