Highroad Engine v1.3
|
Add this component to a UI rectangle and it'll act as a detection zone for a joystick. Note that this component extends the MMTouchJoystick class so you don't need to add another joystick to it. It's both the detection zone and the stick itself. More...
Public Member Functions | |
override void | Initialize () |
virtual void | OnPointerDown (PointerEventData data) |
When the zone is pressed, we move our joystick accordingly More... | |
override void | OnEndDrag (PointerEventData eventData) |
When the player lets go of the stick, we restore our stick's position if needed More... | |
Public Member Functions inherited from MoreMountains.Tools.MMTouchJoystick | |
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... | |
Public Attributes | |
CanvasGroup | KnobCanvasGroup |
CanvasGroup | BackgroundCanvasGroup |
Public Attributes inherited from MoreMountains.Tools.MMTouchJoystick | |
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 | |
override void | Start () |
On Start, we instantiate our joystick's image if there's one More... | |
Protected Member Functions inherited from MoreMountains.Tools.MMTouchJoystick | |
virtual void | Awake () |
On Start, we get our working canvas, and we set our neutral position More... | |
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 | |
Vector3 | _initialPosition |
Vector3 | _newPosition |
CanvasGroup | _knobCanvasGroup |
Protected Attributes inherited from MoreMountains.Tools.MMTouchJoystick | |
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 |
Additional Inherited Members | |
Properties inherited from MoreMountains.Tools.MMTouchJoystick | |
RenderMode | ParentCanvasRenderMode [getprotected set] |
Add this component to a UI rectangle and it'll act as a detection zone for a joystick. Note that this component extends the MMTouchJoystick class so you don't need to add another joystick to it. It's both the detection zone and the stick itself.
|
virtual |
Reimplemented from MoreMountains.Tools.MMTouchJoystick.
|
virtual |
When the player lets go of the stick, we restore our stick's position if needed
eventData | Event data. |
Reimplemented from MoreMountains.Tools.MMTouchJoystick.
|
virtual |
When the zone is pressed, we move our joystick accordingly
data | Data. |
|
protectedvirtual |
On Start, we instantiate our joystick's image if there's one
Reimplemented from MoreMountains.Tools.MMTouchJoystick.
|
protected |
|
protected |
|
protected |
CanvasGroup MoreMountains.Tools.MMTouchRepositionableJoystick.BackgroundCanvasGroup |
CanvasGroup MoreMountains.Tools.MMTouchRepositionableJoystick.KnobCanvasGroup |