Exemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            ItemLabelsBase labels = (ItemLabelsBase)target;

            if (labels.gameObject == null)
            {
                return;
            }

            AnyChart chart = labels.gameObject.GetComponent <AnyChart>();

            if (chart == null)
            {
                return;
            }
            if (isSupported(chart) == false)
            {
                EditorGUILayout.HelpBox(string.Format("Chart of type {0} does not support {1}", chart.GetType().Name, Name), MessageType.Warning);
                return;
            }
            base.OnInspectorGUI();
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            AxisBase axis = (AxisBase)target;

            if (axis.gameObject == null)
            {
                return;
            }

            AnyChart chart = axis.gameObject.GetComponent <AnyChart>();

            if (chart == null)
            {
                return;
            }
            if ((chart is AxisChart) == false)
            {
                EditorGUILayout.LabelField(string.Format("Chart of type {0} does not support axis", chart.GetType().Name));
                return;
            }
            SerializedProperty simpleViewProp = serializedObject.FindProperty("SimpleView");

            if (simpleViewProp == null)
            {
                return;
            }

            Type canvasType = (chart is ICanvas) ? typeof(CanvasAttribute) : typeof(NonCanvasAttribute);

            EditorGUILayout.BeginVertical();
            bool negate = false;

            if (simpleViewProp.boolValue == true)
            {
                negate = GUILayout.Button("Advanced View");
            }
            else
            {
                negate = GUILayout.Button("Simple View");
            }
            if (negate)
            {
                simpleViewProp.boolValue = !simpleViewProp.boolValue;
            }
            bool simple = simpleViewProp.boolValue;


            SerializedProperty depth = serializedObject.FindProperty("depth");

            if (depth != null)
            {
                EditorGUILayout.PropertyField(depth);
            }
            SerializedProperty format = serializedObject.FindProperty("format");

            EditorGUILayout.PropertyField(format);
            if (simple)
            {
                DoSimpleView(canvasType);
            }
            else
            {
                DoAdvanvedView(canvasType, true);
            }

            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
            serializedObject.Update();
        }