mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 14:30:10 +00:00
0.2版本,重构代码,增加Editor
This commit is contained in:
31
Scripts/Editor/BarChartEditor.cs
Normal file
31
Scripts/Editor/BarChartEditor.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEditor;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor class used to edit UI BarChart.
|
||||
/// </summary>
|
||||
|
||||
[CustomEditor(typeof(BarChart), false)]
|
||||
public class BarChartEditor : CoordinateChartEditor
|
||||
{
|
||||
protected SerializedProperty m_Bar;
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
m_Target = (BarChart)target;
|
||||
m_Bar = serializedObject.FindProperty("m_Bar");
|
||||
}
|
||||
|
||||
protected override void OnEndInspectorGUI()
|
||||
{
|
||||
base.OnEndInspectorGUI();
|
||||
if (m_Target == null && target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
EditorGUILayout.PropertyField(m_Bar, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user