Files
XCharts/Editor/PropertyDrawers/PolarDrawer.cs

30 lines
1013 B
C#
Raw Normal View History

2021-01-11 08:54:28 +08:00
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
2020-07-01 09:38:00 +08:00
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Polar), true)]
2021-01-11 08:54:28 +08:00
public class PolarDrawer : BasePropertyDrawer
2020-07-01 09:38:00 +08:00
{
2021-01-11 08:54:28 +08:00
public override string ClassName { get { return "Polar"; } }
2020-07-01 09:38:00 +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, "m_Show"))
2020-07-01 09:38:00 +08:00
{
2021-01-11 08:54:28 +08:00
++EditorGUI.indentLevel;
PropertyTwoFiled(prop, "m_Center");
PropertyField(prop, "m_Radius");
PropertyField(prop, "m_BackgroundColor");
--EditorGUI.indentLevel;
2020-07-01 09:38:00 +08:00
}
}
}
}