Ejemplo n.º 1
0
        /// <summary>
        /// ShowEvents
        /// </summary>
        /// <param name="size"></param>
        public static void ShowEvents()
        {
            serializedObject.Update();

            StyleHelper.StandardSpace();
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Events", StyleHelper.labelStyle);
            StyleHelper.StandardSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Broadcasting", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.broadcast = System.Convert.ToBoolean(GUILayout.Toolbar(System.Convert.ToInt32(myTarget.broadcast), stateNames, GUILayout.Height(15)));
            GUILayout.EndHorizontal();

            StyleHelper.StandardSpace();

            if (myTarget.broadcast)
            {
                EditorGUILayout.PropertyField(downEventProp, false, null);
                EditorGUILayout.PropertyField(pressEventProp, false, null);
                EditorGUILayout.PropertyField(upEventProp, false, null);
                EditorGUILayout.PropertyField(clickEventProp, false, null);
                EditorGUILayout.PropertyField(alwaysEventProp, false, null);
            }

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);

            ParametersHelper.ShowEUpdateType();

            StyleHelper.StandardSpace();
            myTarget.isEnable = ParametersHelper.ShowBoolField(myTarget.isEnable, "Enable");

            if (myTarget.isEnable)
            {
                myTarget.isActive = ParametersHelper.ShowBoolField(myTarget.isActive, "Active", StyleHelper.STANDARD_INDENT);
            }

            ParametersHelper.ShowName("Touchpad Name");
            ParametersHelper.ShowSensitivity();
            ParametersHelper.ShowTouchZone();

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            AxesHelper.ShowAxes(myTarget);
            EventsHelper.ShowEvents();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Show Axes
        /// </summary>
        /// <param name="size"></param>
        /// <param name="hideVert"></param>
        public static void ShowAxes(AxesBasedController target, bool hideVert = false)
        {
            StyleHelper.StandardSpace();
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Axes", StyleHelper.labelStyle);
            StyleHelper.StandardSpace();

            ShowAxis(ref target.axisX, "Horizontal ( Axis X )");

            if (!hideVert)
            {
                ShowAxis(ref target.axisY, "Vertical ( Axis Y )");
            }

            GUI.enabled = target.axisX.enabled || target.axisY.enabled;
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10f);
            target.axesLag = EditorGUILayout.Toggle(target.axesLag, GUILayout.Width(15f));
            GUILayout.Label("Lag", GUILayout.Width(25f));
            GUI.enabled         = target.axesLag;
            target.axesLagSpeed = EditorGUILayout.Slider(target.axesLagSpeed, 5f, 25f);
            GUI.enabled         = true;
            GUILayout.EndHorizontal();
            GUI.enabled = true;

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();
        }
Ejemplo n.º 4
0
 // ShowSensitivity
 public static void ShowSensitivity()
 {
     StyleHelper.StandardSpace();
     GUILayout.BeginHorizontal();
     GUILayout.Label("Sensitivity", GUILayout.Width(StyleHelper.STANDARD_SIZE));
     abController.sensitivity = EditorGUILayout.Slider(abController.sensitivity, 1f, 10f);
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 5
0
 // ShowName
 public static void ShowName(string name)
 {
     StyleHelper.StandardSpace();
     GUILayout.BeginHorizontal();
     GUILayout.Label(name, GUILayout.Width(StyleHelper.STANDARD_SIZE));
     controller.MyName = EditorGUILayout.TextField(controller.MyName);
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 6
0
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);

            ParametersHelper.ShowUpdateType();

            StyleHelper.StandardSpace();
            myTarget.isEnable = ParametersHelper.ShowBoolField(myTarget.isEnable, "Enable");

            if (myTarget.isEnable)
            {
                myTarget.isActive  = ParametersHelper.ShowBoolField(myTarget.isActive, "Active", StyleHelper.STANDARD_INDENT);
                myTarget.isVisible = ParametersHelper.ShowBoolField(myTarget.isVisible, "Visible", StyleHelper.STANDARD_INDENT);
            }

            ParametersHelper.ShowName("Joystick Name");

            StyleHelper.StandardSpace();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Mode", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.IsStatic = System.Convert.ToBoolean(GUILayout.Toolbar(System.Convert.ToInt32(myTarget.IsStatic), modNames, GUILayout.Height(20)));
            GUILayout.EndHorizontal();

            ParametersHelper.ShowSensitivity();

            StyleHelper.StandardSpace();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Border Size", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.borderSize = EditorGUILayout.Slider(myTarget.borderSize, 1f, 9f);
            GUILayout.EndHorizontal();

            StyleHelper.StandardSpace();

            if (myTarget.IsStatic)
            {
                GUILayout.BeginHorizontal();
                myTarget.smoothReturn = EditorGUILayout.Toggle(myTarget.smoothReturn, GUILayout.Width(15f));
                GUILayout.Label("Smooth Return", GUILayout.Width(StyleHelper.STANDARD_SIZE - 20f));
                GUI.enabled           = myTarget.smoothReturn;
                myTarget.smoothFactor = EditorGUILayout.Slider(myTarget.smoothFactor, 1f, 20f);
                GUI.enabled           = true;
                GUILayout.EndHorizontal();
            }

            ParametersHelper.ShowTouchZone();

            StyleHelper.StandardSpace();
            ParametersHelper.ShowSpriteAndColor(ref myTarget.joystickImage, "Joystick");
            ParametersHelper.ShowSpriteAndColor(ref myTarget.joystickBackgroundImage, "Background");

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            AxesHelper.ShowAxes();
            EventsHelper.ShowEvents();
        }
Ejemplo n.º 7
0
 // ShowSensitivity
 public static void ShowUpdateType()
 {
     GUI.enabled = (controller.isEnable && controller.isActive);
     StyleHelper.StandardSpace();
     GUILayout.BeginHorizontal();
     GUILayout.Label("Update Type", GUILayout.Width(StyleHelper.STANDARD_SIZE));
     controller.updateType = ( UpdateType )EditorGUILayout.EnumPopup(controller.updateType);
     GUILayout.EndHorizontal();
     GUI.enabled = true;
 }
Ejemplo n.º 8
0
 // ShowTouchZone
 public static void ShowTouchZone()
 {
     StyleHelper.StandardSpace();
     GUILayout.BeginHorizontal();
     abController.ShowTouchZone = EditorGUILayout.Toggle(abController.ShowTouchZone, GUILayout.Width(15f));
     GUILayout.Label("TZone Sprite", GUILayout.Width(StyleHelper.STANDARD_SIZE - 20f));
     GUI.enabled = abController.ShowTouchZone;
     abController.baseImage.color  = EditorGUILayout.ColorField(abController.baseImage.color, GUILayout.Width(StyleHelper.STANDARD_SIZE / 2f));
     abController.baseImage.sprite = EditorGUILayout.ObjectField(abController.baseImage.sprite, typeof(Sprite), false) as Sprite;
     GUI.enabled = true;
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 9
0
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);
            StyleHelper.StandardSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Arrow Type", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.arrowType = ( EArrowType )EditorGUILayout.EnumPopup(myTarget.arrowType);
            GUILayout.EndHorizontal();

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();
        }
Ejemplo n.º 10
0
        // OnInspectorGUI
        public override void OnInspectorGUI()
        {
            // BEGIN
            GUILayout.BeginVertical("Box", GUILayout.Width(300f));
            StyleHelper.StandardSpace();
            //

            ShowParameters();

            if (GUI.changed)
            {
                Dirty();
            }

            // END
            StyleHelper.StandardSpace();
            GUILayout.EndVertical();
            //
        }
Ejemplo n.º 11
0
        /// <summary>
        /// ShowAxes
        /// </summary>
        /// <param name="size"></param>
        /// <param name="hideVert"></param>
        public static void ShowAxes(bool hideVert = false)
        {
            StyleHelper.StandardSpace();
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Axes", StyleHelper.labelStyle);
            StyleHelper.StandardSpace();

            ShowAxis(ref myTarget.axisX, "X");

            if (hideVert)
            {
                StyleHelper.StandardSpace();
                GUILayout.EndVertical();
                return;
            }

            ShowAxis(ref myTarget.axisY, "Y");

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();
        }
Ejemplo n.º 12
0
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);

            ParametersHelper.ShowUpdateType();

            StyleHelper.StandardSpace();
            myTarget.isEnable = ParametersHelper.ShowBoolField(myTarget.isEnable, "Enable");

            if (myTarget.isEnable)
            {
                myTarget.isActive  = ParametersHelper.ShowBoolField(myTarget.isActive, "Active", StyleHelper.STANDARD_INDENT);
                myTarget.isVisible = ParametersHelper.ShowBoolField(myTarget.isVisible, "Visible", StyleHelper.STANDARD_INDENT);
            }

            ParametersHelper.ShowName("DPad Name");
            ParametersHelper.ShowSensitivity();
            ParametersHelper.ShowTouchZone();

            StyleHelper.StandardSpace();

            Sprite sprite = myTarget.normalSprite;

            ParametersHelper.ShowSpriteAndColor(ref sprite, ref myTarget.normalColor, "Norm Arrow");
            myTarget.normalSprite = sprite;

            if (GUI.changed)
            {
                myTarget.ControlAwake();
            }

            ParametersHelper.ShowSpriteAndColor(ref myTarget.pressedSprite, ref myTarget.pressedColor, "Press Arrow");

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            AxesHelper.ShowAxes();
            EventsHelper.ShowEvents();
        }
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);

            ParametersHelper.ShowUpdateType();

            StyleHelper.StandardSpace();
            myTarget.isEnable = ParametersHelper.ShowBoolField(myTarget.isEnable, "Enable");

            if (myTarget.isEnable)
            {
                myTarget.isActive  = ParametersHelper.ShowBoolField(myTarget.isActive, "Active", StyleHelper.STANDARD_INDENT);
                myTarget.isVisible = ParametersHelper.ShowBoolField(myTarget.isVisible, "Visible", StyleHelper.STANDARD_INDENT);
            }

            ParametersHelper.ShowName("Wheel Name");
            ParametersHelper.ShowSensitivity();

            StyleHelper.StandardSpace();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Max Steering Angle", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.maxSteeringAngle = EditorGUILayout.Slider(myTarget.maxSteeringAngle, 36f, 360f);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Released Speed", GUILayout.Width(StyleHelper.STANDARD_SIZE));
            myTarget.releasedSpeed = EditorGUILayout.Slider(myTarget.releasedSpeed, 25f, 150f);
            GUILayout.EndHorizontal();

            StyleHelper.StandardSpace();
            ParametersHelper.ShowSpriteAndColor(ref myTarget.baseImage, "Wheel");

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            AxesHelper.ShowAxes(true);
            EventsHelper.ShowEvents();
        }
Ejemplo n.º 14
0
        // ShowParameters
        protected override void ShowParameters()
        {
            GUILayout.BeginVertical("Box");
            GUILayout.Label("Parameters", StyleHelper.labelStyle);

            ParametersHelper.ShowEUpdateType();

            StyleHelper.StandardSpace();
            myTarget.isEnable = ParametersHelper.ShowBoolField(myTarget.isEnable, "Enable");

            if (myTarget.isEnable)
            {
                myTarget.isActive  = ParametersHelper.ShowBoolField(myTarget.isActive, "Active", StyleHelper.STANDARD_INDENT);
                myTarget.isVisible = ParametersHelper.ShowBoolField(myTarget.isVisible, "Visible", StyleHelper.STANDARD_INDENT);
            }

            ParametersHelper.ShowName("Button Name");

            StyleHelper.StandardSpace();
            myTarget.swipeOut = ParametersHelper.ShowBoolField(myTarget.swipeOut, "Swipe Out");

            StyleHelper.StandardSpace();

            Sprite sprite = myTarget.normalSprite;

            ParametersHelper.ShowSpriteAndColor(ref sprite, ref myTarget.normalColor, "Normal");
            myTarget.normalSprite    = sprite;
            myTarget.baseImage.color = myTarget.isVisible ? myTarget.normalColor : ( Color32 )Color.clear;

            ParametersHelper.ShowSpriteAndColor(ref myTarget.pressedSprite, ref myTarget.pressedColor, "Pressed");

            StyleHelper.StandardSpace();
            GUILayout.EndVertical();

            EventsHelper.ShowEvents();
        }