mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
XCharts 2.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -13,56 +13,41 @@ 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_Grids;
|
||||
protected SerializedProperty m_MultipleXAxis;
|
||||
protected SerializedProperty m_XAxises;
|
||||
protected SerializedProperty m_XAxes;
|
||||
protected SerializedProperty m_MultipleYAxis;
|
||||
protected SerializedProperty m_YAxises;
|
||||
protected SerializedProperty m_DataZoom;
|
||||
protected SerializedProperty m_VisualMap;
|
||||
protected SerializedProperty m_YAxes;
|
||||
protected SerializedProperty m_DataZooms;
|
||||
protected SerializedProperty m_VisualMaps;
|
||||
|
||||
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");
|
||||
m_Chart = (CoordinateChart)target;
|
||||
m_Grids = serializedObject.FindProperty("m_Grids");
|
||||
m_XAxes = serializedObject.FindProperty("m_XAxes");
|
||||
m_YAxes = serializedObject.FindProperty("m_YAxes");
|
||||
m_DataZooms = serializedObject.FindProperty("m_DataZooms");
|
||||
m_VisualMaps = serializedObject.FindProperty("m_VisualMaps");
|
||||
}
|
||||
|
||||
protected override void OnStartInspectorGUI()
|
||||
{
|
||||
base.OnStartInspectorGUI();
|
||||
if (m_Target is LineChart || m_Target is BarChart)
|
||||
{
|
||||
EditorGUILayout.PropertyField(m_DataZoom);
|
||||
}
|
||||
if (m_Target is HeatmapChart || m_Target is LineChart)
|
||||
{
|
||||
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);
|
||||
}
|
||||
BlockListField(m_ShowAllComponent, m_DataZooms);
|
||||
BlockListField(m_ShowAllComponent, m_VisualMaps);
|
||||
BlockListField(m_ShowAllComponent, m_Grids);
|
||||
BlockListField(m_ShowAllComponent, m_XAxes);
|
||||
BlockListField(m_ShowAllComponent, m_YAxes);
|
||||
}
|
||||
|
||||
protected override void OnEndInspectorGUI()
|
||||
protected override void MoreDebugInspector()
|
||||
{
|
||||
base.OnEndInspectorGUI();
|
||||
base.MoreDebugInspector();
|
||||
CovertXYAxis();
|
||||
}
|
||||
|
||||
@@ -70,7 +55,7 @@ namespace XCharts
|
||||
{
|
||||
if (GUILayout.Button("Covert XY Axis"))
|
||||
{
|
||||
(m_Target as CoordinateChart).CovertXYAxis(0);
|
||||
(m_Chart as CoordinateChart).CovertXYAxis(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user