From a1dc6ca8ad3246f9218a5504627d475262d25b10 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 25 Jul 2019 21:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Demo/Editor/ChartModuleDrawer.cs | 2 -- Demo/Scripts/Demo.cs | 3 +-- Scripts/Editor/BaseChartEditor.cs | 6 ------ Scripts/Editor/PropertyDrawers/SerieDrawer.cs | 3 --- Scripts/Editor/PropertyDrawers/SerieSymbolDrawer.cs | 10 ---------- Scripts/UI/BarChart.cs | 1 - Scripts/UI/ScatterChart.cs | 1 - Scripts/UI/Utility/ChartHelper.cs | 2 +- 8 files changed, 2 insertions(+), 26 deletions(-) diff --git a/Demo/Editor/ChartModuleDrawer.cs b/Demo/Editor/ChartModuleDrawer.cs index e2715f2f..b8cfbf88 100644 --- a/Demo/Editor/ChartModuleDrawer.cs +++ b/Demo/Editor/ChartModuleDrawer.cs @@ -6,8 +6,6 @@ namespace XCharts [CustomPropertyDrawer(typeof(ChartModule), true)] public class ChartModuleDrawer : PropertyDrawer { - bool m_BarModuleToggle = true; - public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { Rect drawRect = pos; diff --git a/Demo/Scripts/Demo.cs b/Demo/Scripts/Demo.cs index e9d906c3..b615d41a 100644 --- a/Demo/Scripts/Demo.cs +++ b/Demo/Scripts/Demo.cs @@ -85,7 +85,6 @@ public class Demo : MonoBehaviour void InitModuleButton() { - var font = Resources.GetBuiltinResource("Arial.ttf"); var btnPanel = transform.Find("chart_list"); m_BtnClone = transform.Find("btn_clone").gameObject; m_BtnClone.SetActive(false); @@ -104,7 +103,7 @@ public class Demo : MonoBehaviour btn = GameObject.Instantiate(m_BtnClone); btn.SetActive(true); btn.name = btnName; - btn.transform.parent = btnPanel; + btn.transform.SetParent(btnPanel); btn.transform.localPosition = Vector3.zero; } btn.transform.localScale = Vector3.one; diff --git a/Scripts/Editor/BaseChartEditor.cs b/Scripts/Editor/BaseChartEditor.cs index 6ac4b982..312520db 100644 --- a/Scripts/Editor/BaseChartEditor.cs +++ b/Scripts/Editor/BaseChartEditor.cs @@ -28,15 +28,9 @@ namespace XCharts protected float m_DefaultLabelWidth; protected float m_DefaultFieldWidth; - private int m_SeriesSize; - - - private bool m_ThemeModuleToggle = false; private bool m_BaseModuleToggle = false; - - protected virtual void OnEnable() { m_Target = (BaseChart)target; diff --git a/Scripts/Editor/PropertyDrawers/SerieDrawer.cs b/Scripts/Editor/PropertyDrawers/SerieDrawer.cs index 3534e1d3..7d23179c 100644 --- a/Scripts/Editor/PropertyDrawers/SerieDrawer.cs +++ b/Scripts/Editor/PropertyDrawers/SerieDrawer.cs @@ -10,7 +10,6 @@ namespace XCharts private List m_SerieModuleToggle = new List(); private List m_DataFoldout = new List(); - private int m_DataSize = 0; private bool m_ShowJsonDataArea = false; private string m_JsonDataAreaText; @@ -160,8 +159,6 @@ namespace XCharts EditorGUIUtility.fieldWidth = lastFieldWid; EditorGUIUtility.labelWidth = lastLabelWid; } - SerializedProperty element1 = data.GetArrayElementAtIndex(0); - SerializedProperty element2 = data.GetArrayElementAtIndex(1); } public override float GetPropertyHeight(SerializedProperty prop, GUIContent label) diff --git a/Scripts/Editor/PropertyDrawers/SerieSymbolDrawer.cs b/Scripts/Editor/PropertyDrawers/SerieSymbolDrawer.cs index b5699774..8f45859e 100644 --- a/Scripts/Editor/PropertyDrawers/SerieSymbolDrawer.cs +++ b/Scripts/Editor/PropertyDrawers/SerieSymbolDrawer.cs @@ -7,13 +7,6 @@ namespace XCharts [CustomPropertyDrawer(typeof(SerieSymbol), true)] public class SerieSymbolDrawer : PropertyDrawer { - - private List m_SerieModuleToggle = new List(); - private List m_DataFoldout = new List(); - private int m_DataSize = 0; - private bool m_ShowJsonDataArea = false; - private string m_JsonDataAreaText; - public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { Rect drawRect = pos; @@ -26,9 +19,6 @@ namespace XCharts SerializedProperty m_DataScale = prop.FindPropertyRelative("m_DataScale"); SerializedProperty m_SelectedDataScale = prop.FindPropertyRelative("m_SelectedDataScale"); - SerializedProperty m_SizeCallback = prop.FindPropertyRelative("m_SizeCallback"); - SerializedProperty m_SelectedSizeCallback = prop.FindPropertyRelative("m_SelectedSizeCallback"); - EditorGUI.PropertyField(drawRect, m_Type, new GUIContent("Symbol Type")); drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.PropertyField(drawRect, m_SizeType, new GUIContent("Symbol SizeType")); diff --git a/Scripts/UI/BarChart.cs b/Scripts/UI/BarChart.cs index a44180a7..a1054995 100644 --- a/Scripts/UI/BarChart.cs +++ b/Scripts/UI/BarChart.cs @@ -167,7 +167,6 @@ namespace XCharts serieNameSet.Clear(); for (int j = 0; j < seriesCount; j++) { - var seriesHig = new Dictionary(); var serieList = stackSeries[j]; seriesCurrHig.Clear(); if (seriesCurrHig.Capacity != serieList[0].dataCount) diff --git a/Scripts/UI/ScatterChart.cs b/Scripts/UI/ScatterChart.cs index 8eb85972..6080d720 100644 --- a/Scripts/UI/ScatterChart.cs +++ b/Scripts/UI/ScatterChart.cs @@ -89,7 +89,6 @@ namespace XCharts int maxCount = maxShowDataNumber > 0 ? (maxShowDataNumber > serie.dataCount ? serie.dataCount : maxShowDataNumber) : serie.dataCount; - int dataCount = (maxCount - minShowDataNumber); for (int n = minShowDataNumber; n < maxCount; n++) { float xValue, yValue; diff --git a/Scripts/UI/Utility/ChartHelper.cs b/Scripts/UI/Utility/ChartHelper.cs index 99329fcd..0e57f4a2 100644 --- a/Scripts/UI/Utility/ChartHelper.cs +++ b/Scripts/UI/Utility/ChartHelper.cs @@ -84,7 +84,7 @@ namespace XCharts { obj = new GameObject(); obj.name = name; - obj.transform.parent = parent; + obj.transform.SetParent(parent); obj.transform.localScale = Vector3.one; obj.transform.localPosition = Vector3.zero; }