mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 17:30:10 +00:00
发布1.0.0版本
This commit is contained in:
56
Editor/CoordinateChartEditor.cs
Normal file
56
Editor/CoordinateChartEditor.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor class used to edit UI CoordinateChart.
|
||||
/// </summary>
|
||||
|
||||
[CustomEditor(typeof(CoordinateChart), false)]
|
||||
public class CoordinateChartEditor : BaseChartEditor
|
||||
{
|
||||
protected SerializedProperty m_Grid;
|
||||
protected SerializedProperty m_MultipleXAxis;
|
||||
protected SerializedProperty m_XAxises;
|
||||
protected SerializedProperty m_MultipleYAxis;
|
||||
protected SerializedProperty m_YAxises;
|
||||
protected SerializedProperty m_DataZoom;
|
||||
protected SerializedProperty m_VisualMap;
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
m_Target = (CoordinateChart)target;
|
||||
m_Grid = serializedObject.FindProperty("m_Grid");
|
||||
m_XAxises = serializedObject.FindProperty("m_XAxises");
|
||||
m_YAxises = serializedObject.FindProperty("m_YAxises");
|
||||
m_DataZoom = serializedObject.FindProperty("m_DataZoom");
|
||||
m_VisualMap = serializedObject.FindProperty("m_VisualMap");
|
||||
}
|
||||
|
||||
protected override void OnStartInspectorGUI()
|
||||
{
|
||||
base.OnStartInspectorGUI();
|
||||
EditorGUILayout.PropertyField(m_DataZoom);
|
||||
EditorGUILayout.PropertyField(m_VisualMap);
|
||||
EditorGUILayout.PropertyField(m_Grid);
|
||||
for (int i = 0; i < m_XAxises.arraySize; i++)
|
||||
{
|
||||
SerializedProperty axis = m_XAxises.GetArrayElementAtIndex(i);
|
||||
EditorGUILayout.PropertyField(axis);
|
||||
}
|
||||
for (int i = 0; i < m_YAxises.arraySize; i++)
|
||||
{
|
||||
SerializedProperty axis = m_YAxises.GetArrayElementAtIndex(i);
|
||||
EditorGUILayout.PropertyField(axis);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user