mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 13:30:10 +00:00
40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
/************************************************/
|
|
/* */
|
|
/* Copyright (c) 2018 - 2021 monitor1394 */
|
|
/* https://github.com/monitor1394 */
|
|
/* */
|
|
/************************************************/
|
|
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace XCharts
|
|
{
|
|
[CustomPropertyDrawer(typeof(Settings), true)]
|
|
public class SettingsDrawer : BasePropertyDrawer
|
|
{
|
|
public override string ClassName { get { return "Settings"; } }
|
|
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
|
{
|
|
base.OnGUI(pos, prop, label);
|
|
if (MakeFoldout(prop, ""))
|
|
{
|
|
var btnWidth = 50;
|
|
var btnRect = new Rect(pos.x + pos.width - btnWidth, pos.y, btnWidth, EditorGUIUtility.singleLineHeight);
|
|
if (GUI.Button(btnRect, new GUIContent("Reset", "Reset to default settings")))
|
|
{
|
|
var chart = prop.serializedObject.targetObject as BaseChart;
|
|
chart.settings.Reset();
|
|
}
|
|
++EditorGUI.indentLevel;
|
|
PropertyField(prop, "m_MaxPainter");
|
|
PropertyField(prop, "m_LineSmoothStyle");
|
|
PropertyField(prop, "m_LineSmoothness");
|
|
PropertyField(prop, "m_LineSegmentDistance");
|
|
PropertyField(prop, "m_CicleSmoothness");
|
|
|
|
--EditorGUI.indentLevel;
|
|
}
|
|
}
|
|
}
|
|
} |