Ejemplo n.º 1
0
        protected virtual void OnSceneGUI()
        {
            SmartChart chart = (SmartChart)target;

            if (useCustomHandles)
            {
                Undo.RecordObject(chart.GetComponent <RectTransform>(), "chart rect modification");
                RectHandles.ResizeRect(chart.GetComponent <RectTransform>(), Handles.CubeHandleCap, Color.cyan, HandleUtility.GetHandleSize(Vector3.zero) * 0.35f, 1);
            }
            chart.UpdateChart();
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            SetupStyles();
            serializedObject.Update();
            chart = (SmartChart)target;
            EditorGUI.BeginChangeCheck();

            GUILayout.BeginVertical("box");
            EditorGUI.indentLevel++;
            ChartDataSection();
            SizingOptionsSection();
            AxesOptionsSection();
            GridOptionsSection();
            LabelsOptionsSection();
            MarkersOptionsSection();
            EditorGUI.indentLevel--;
            EditorGUILayout.Space();
            GUI.backgroundColor = Color.white;
            SerializedProperty uch = serializedObject.FindProperty("useCustomHandles");

            EditorGUILayout.PropertyField(uch, new GUIContent("Use Custom Handles (experimental)"));
            useCustomHandles = uch.boolValue;
            GUILayout.EndVertical();


            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();

                int dataCount = 0;
                for (int i = 0; i < chart.chartData.Length; i++)
                {
                    dataCount += chart.chartData[i].data.Length;
                }

                chart.DeleteMarkers(dataCount);
                chart.SetupValues(true);
                chart.UpdateChart();
            }
        }