Пример #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            MalbersEditor.DrawDescription("Mobile Joystick Logic");


            EditorGUILayout.BeginVertical(MalbersEditor.StyleGray);
            {
                MalbersEditor.DrawScript(script);

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    if (MalbersEditor.Foldout(AxisEditor, "Axis Properties"))
                    {
                        EditorGUILayout.BeginHorizontal();
                        {
                            MalbersEditor.BoolButton(invertX, new GUIContent("Invert X"));
                            MalbersEditor.BoolButton(invertY, new GUIContent("Invert Y"));
                            MalbersEditor.BoolButton(Relative, new GUIContent("Drag"));
                        }
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.PropertyField(deathpoint);
                        EditorGUILayout.PropertyField(sensitivityX);
                        EditorGUILayout.PropertyField(sensitivityY);
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    if (MalbersEditor.Foldout(ReferencesEditor, "References"))
                    {
                        EditorGUILayout.PropertyField(axisValue);
                        EditorGUILayout.PropertyField(pressed);
                    }
                }
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    EventsEditor.boolValue = MalbersEditor.Foldout(EventsEditor, "Events");

                    if (EventsEditor.boolValue)
                    {
                        EditorGUILayout.PropertyField(OnJoystickDown);
                        EditorGUILayout.PropertyField(OnJoystickUp);
                        EditorGUILayout.PropertyField(OnJoystickPressed);
                        EditorGUILayout.Space();
                        EditorGUILayout.PropertyField(OnAxisChange);
                        EditorGUILayout.PropertyField(OnXAxisChange);
                        EditorGUILayout.PropertyField(OnYAxisChange);
                    }
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();
        }