Files
XCharts/Editor/PropertyDrawers/LineArrowDrawer.cs

50 lines
1.7 KiB
C#
Raw Normal View History

2021-01-11 08:54:28 +08:00
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
2019-09-19 19:26:05 +08:00
using UnityEditor;
using UnityEngine;
namespace XCharts
{
2021-01-11 08:54:28 +08:00
[CustomPropertyDrawer(typeof(Arrow), true)]
public class ArrowDrawer : BasePropertyDrawer
2019-09-19 19:26:05 +08:00
{
2021-01-11 08:54:28 +08:00
public override string ClassName { get { return "Arrow"; } }
2019-09-19 19:26:05 +08:00
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, ""))
2019-09-19 19:26:05 +08:00
{
++EditorGUI.indentLevel;
2021-01-11 08:54:28 +08:00
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Dent");
PropertyField(prop, "m_Color");
2019-09-19 19:26:05 +08:00
--EditorGUI.indentLevel;
}
}
2021-01-11 08:54:28 +08:00
}
[CustomPropertyDrawer(typeof(LineArrow), true)]
public class LineArrowStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "LineArrow"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
2019-09-19 19:26:05 +08:00
{
2021-01-11 08:54:28 +08:00
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
2019-09-19 19:26:05 +08:00
{
2021-01-11 08:54:28 +08:00
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Arrow");
--EditorGUI.indentLevel;
2019-09-19 19:26:05 +08:00
}
}
}
}