Files
XCharts/Editor/PropertyDrawers/LegendDrawer.cs

38 lines
1.4 KiB
C#
Raw Normal View History

2021-01-11 08:54:28 +08:00
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Legend), true)]
2021-01-11 08:54:28 +08:00
public class LegendDrawer : BasePropertyDrawer
{
2021-01-11 08:54:28 +08:00
public override string ClassName { get { return "Legend"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
2021-01-11 08:54:28 +08:00
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
2021-01-11 08:54:28 +08:00
PropertyField(prop, "m_ItemWidth");
PropertyField(prop, "m_ItemHeight");
PropertyField(prop, "m_ItemGap");
PropertyField(prop, "m_ItemAutoColor");
PropertyField(prop, "m_SelectedMode");
PropertyField(prop, "m_Orient");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_TextStyle");
2021-01-17 22:52:32 +08:00
PropertyListField(prop, "m_Icons");
PropertyListField(prop, "m_Data");
--EditorGUI.indentLevel;
}
}
}
}