// 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(); }
// 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(); }
// OnEnable void OnEnable() { myTarget = ( TCKJoystick )target; ParametersHelper.HelperSetup(myTarget, myTarget); AxesHelper.HelperSetup(myTarget); EventsHelper.HelperSetup(myTarget, serializedObject); myTarget.ControlAwake(); }
// 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(); }