mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 20:28:46 +00:00
增加LabelStyle的showCondition,showFilter,showThreshold可控制label显示和隐藏
This commit is contained in:
@@ -507,6 +507,28 @@ namespace XCharts.Editor
|
||||
{
|
||||
return PropertyField(ref drawRect, heights, key, parentProp.FindPropertyRelative(relativeName));
|
||||
}
|
||||
|
||||
public static bool PropertyFlagsField(ref Rect drawRect, Dictionary<string, float> heights, string key,
|
||||
SerializedProperty parentProp, string relativeName, System.Type enumType)
|
||||
{
|
||||
return PropertyFlagsField(ref drawRect, heights, key, parentProp.FindPropertyRelative(relativeName), enumType);
|
||||
}
|
||||
|
||||
public static bool PropertyFlagsField(ref Rect drawRect, Dictionary<string, float> heights, string key,
|
||||
SerializedProperty prop, System.Type enumType)
|
||||
{
|
||||
if (prop == null) return false;
|
||||
var label = GetContent(prop.displayName);
|
||||
var enumValue = (System.Enum)System.Enum.ToObject(enumType, prop.intValue);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var newValue = EditorGUI.EnumFlagsField(drawRect, label, enumValue);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
prop.intValue = (int)(object)newValue;
|
||||
var hig = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
drawRect.y += hig;
|
||||
heights[key] += hig;
|
||||
return true;
|
||||
}
|
||||
public static bool PropertyFieldWithMinValue(ref Rect drawRect, Dictionary<string, float> heights, string key,
|
||||
SerializedProperty parentProp, string relativeName, float minValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user