Highroad Engine v1.3
|
Joystick input class. In charge of the behaviour of the joystick mobile touch input. Bind its actions from the inspector Handles mouse and multi touch More...
Public Member Functions | |
virtual void | Initialize () |
virtual void | SetKnobTransform (Transform newTransform) |
Assigns a new transform as the joystick knob More... | |
virtual void | SetNeutralPosition () |
Sets the neutral position of the joystick More... | |
virtual void | SetNeutralPosition (Vector3 newPosition) |
virtual void | OnDrag (PointerEventData eventData) |
Handles dragging of the joystick More... | |
virtual void | OnEndDrag (PointerEventData eventData) |
What happens when the stick is released More... | |
Public Attributes | |
Camera | TargetCamera |
float | PressedOpacity = 0.5f |
the new opacity to apply to the canvas group when the button is pressed More... | |
bool | HorizontalAxisEnabled = true |
Is horizontal axis allowed. More... | |
bool | VerticalAxisEnabled = true |
Is vertical axis allowed. More... | |
float | MaxRange = 1.5f |
The max range allowed. More... | |
JoystickEvent | JoystickValue |
The method(s) to call when the button gets pressed down. More... | |
Transform | RotatingIndicator |
an object you can rotate to show the direction of the joystick. Will only be visible if the movement is above a threshold More... | |
float | RotatingIndicatorThreshold = 0.1f |
the threshold above which the rotating indicator will appear More... | |
Vector2 | _joystickValue |
Current horizontal and vertical values of the joystick (from -1 to 1) More... | |
Protected Member Functions | |
virtual void | Awake () |
On Start, we get our working canvas, and we set our neutral position More... | |
virtual void | Start () |
virtual void | Update () |
On Update we check for an orientation change if needed, and send our input values. More... | |
virtual void | RotateIndicator () |
virtual float | EvaluateInputValue (float vectorPosition) |
We compute the axis value from the interval between neutral position, current stick position (vectorPosition) and max range More... | |
virtual void | OnEnable () |
Protected Attributes | |
Vector2 | _neutralPosition |
Store neutral position of the stick. More... | |
RectTransform | _canvasRectTransform |
The canvas rect transform we're working with. More... | |
Vector2 | _newTargetPosition |
working vector More... | |
Vector3 | _newJoystickPosition |
float | _initialZPosition |
CanvasGroup | _canvasGroup |
float | _initialOpacity |
Transform | _knobTransform |
bool | _rotatingIndicatorIsNotNull = false |
Properties | |
RenderMode | ParentCanvasRenderMode [getprotected set] |
Joystick input class. In charge of the behaviour of the joystick mobile touch input. Bind its actions from the inspector Handles mouse and multi touch
|
protectedvirtual |
On Start, we get our working canvas, and we set our neutral position
|
protectedvirtual |
We compute the axis value from the interval between neutral position, current stick position (vectorPosition) and max range
vectorPosition | stick position. |
|
virtual |
Reimplemented in MoreMountains.Tools.MMTouchRepositionableJoystick.
|
virtual |
Handles dragging of the joystick
|
protectedvirtual |
|
virtual |
What happens when the stick is released
Reimplemented in MoreMountains.Tools.MMTouchDynamicJoystick, and MoreMountains.Tools.MMTouchRepositionableJoystick.
|
protectedvirtual |
|
virtual |
Assigns a new transform as the joystick knob
newTransform |
|
virtual |
Sets the neutral position of the joystick
|
virtual |
|
protectedvirtual |
Reimplemented in MoreMountains.Tools.MMTouchDynamicJoystick, and MoreMountains.Tools.MMTouchRepositionableJoystick.
|
protectedvirtual |
On Update we check for an orientation change if needed, and send our input values.
|
protected |
|
protected |
The canvas rect transform we're working with.
|
protected |
|
protected |
Vector2 MoreMountains.Tools.MMTouchJoystick._joystickValue |
Current horizontal and vertical values of the joystick (from -1 to 1)
|
protected |
|
protected |
Store neutral position of the stick.
|
protected |
|
protected |
working vector
|
protected |
bool MoreMountains.Tools.MMTouchJoystick.HorizontalAxisEnabled = true |
Is horizontal axis allowed.
JoystickEvent MoreMountains.Tools.MMTouchJoystick.JoystickValue |
The method(s) to call when the button gets pressed down.
float MoreMountains.Tools.MMTouchJoystick.MaxRange = 1.5f |
The max range allowed.
float MoreMountains.Tools.MMTouchJoystick.PressedOpacity = 0.5f |
the new opacity to apply to the canvas group when the button is pressed
Transform MoreMountains.Tools.MMTouchJoystick.RotatingIndicator |
an object you can rotate to show the direction of the joystick. Will only be visible if the movement is above a threshold
float MoreMountains.Tools.MMTouchJoystick.RotatingIndicatorThreshold = 0.1f |
the threshold above which the rotating indicator will appear
Camera MoreMountains.Tools.MMTouchJoystick.TargetCamera |
bool MoreMountains.Tools.MMTouchJoystick.VerticalAxisEnabled = true |
Is vertical axis allowed.
|
getprotected set |