Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMTouchRepositionableJoystick Class Reference

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...

Inheritance diagram for MoreMountains.Tools.MMTouchRepositionableJoystick:
MoreMountains.Tools.MMTouchJoystick

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]
 

Detailed Description

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.

Member Function Documentation

◆ Initialize()

override void MoreMountains.Tools.MMTouchRepositionableJoystick.Initialize ( )
virtual

◆ OnEndDrag()

override void MoreMountains.Tools.MMTouchRepositionableJoystick.OnEndDrag ( PointerEventData  eventData)
virtual

When the player lets go of the stick, we restore our stick's position if needed

Parameters
eventDataEvent data.

Reimplemented from MoreMountains.Tools.MMTouchJoystick.

◆ OnPointerDown()

virtual void MoreMountains.Tools.MMTouchRepositionableJoystick.OnPointerDown ( PointerEventData  data)
virtual

When the zone is pressed, we move our joystick accordingly

Parameters
dataData.

◆ Start()

override void MoreMountains.Tools.MMTouchRepositionableJoystick.Start ( )
protectedvirtual

On Start, we instantiate our joystick's image if there's one

Reimplemented from MoreMountains.Tools.MMTouchJoystick.

Member Data Documentation

◆ _initialPosition

Vector3 MoreMountains.Tools.MMTouchRepositionableJoystick._initialPosition
protected

◆ _knobCanvasGroup

CanvasGroup MoreMountains.Tools.MMTouchRepositionableJoystick._knobCanvasGroup
protected

◆ _newPosition

Vector3 MoreMountains.Tools.MMTouchRepositionableJoystick._newPosition
protected

◆ BackgroundCanvasGroup

CanvasGroup MoreMountains.Tools.MMTouchRepositionableJoystick.BackgroundCanvasGroup

◆ KnobCanvasGroup

CanvasGroup MoreMountains.Tools.MMTouchRepositionableJoystick.KnobCanvasGroup

The documentation for this class was generated from the following file: