Infinite Runner Engine v2.2
Loading...
Searching...
No Matches
MoreMountains.InfiniteRunnerEngine.TouchZone Class Reference

Add this component to a GUI button to have it act as a proxy for a certain action on touch devices. Detects press down, press up, and continuous press. These are really basic mobile/touch controls. I believe that for infinite runners they're sufficient. More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.TouchZone:

Public Types

enum  TouchZoneActions {
  MainAction , Pause , Left , Right ,
  Up , Down
}
 the list of possible bindable actions More...

Public Member Functions

void OnPointerDown (PointerEventData data)
 Triggers the bound pointer down action.
void OnPointerUp (PointerEventData data)
 Triggers the bound pointer up action.
void OnPointerPressed ()
 Triggers the bound pointer pressed action.

Public Attributes

TouchZoneActions TouchZoneBinding
 the binding of a possible action
bool SendDownEvent = true
 should the component send an event when the zone is pressed down ?
bool SendUpEvent = true
 should the component send an event when the zone is pressed up ?
bool SendPressedEvent = false
 should the component send an event when the zone is being pressed ?

Protected Member Functions

void Start ()
 Triggered at initialization, binds the touch zone to input manager's methods.
void Update ()
 Every frame, if the touch zone is pressed, we trigger the OnPointerPressed method, to detect continuous press.

Protected Attributes

bool _zonePressed = false
string OnPointerDownAction
string OnPointerUpAction
string OnPointerPressedAction

Detailed Description

Add this component to a GUI button to have it act as a proxy for a certain action on touch devices. Detects press down, press up, and continuous press. These are really basic mobile/touch controls. I believe that for infinite runners they're sufficient.

Member Enumeration Documentation

◆ TouchZoneActions

the list of possible bindable actions

Enumerator
MainAction 
Pause 
Left 
Right 
Up 
Down 

Member Function Documentation

◆ OnPointerDown()

void MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerDown ( PointerEventData data)

Triggers the bound pointer down action.

◆ OnPointerPressed()

void MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerPressed ( )

Triggers the bound pointer pressed action.

◆ OnPointerUp()

void MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerUp ( PointerEventData data)

Triggers the bound pointer up action.

◆ Start()

void MoreMountains.InfiniteRunnerEngine.TouchZone.Start ( )
protected

Triggered at initialization, binds the touch zone to input manager's methods.

◆ Update()

void MoreMountains.InfiniteRunnerEngine.TouchZone.Update ( )
protected

Every frame, if the touch zone is pressed, we trigger the OnPointerPressed method, to detect continuous press.

Member Data Documentation

◆ _zonePressed

bool MoreMountains.InfiniteRunnerEngine.TouchZone._zonePressed = false
protected

◆ OnPointerDownAction

string MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerDownAction
protected

◆ OnPointerPressedAction

string MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerPressedAction
protected

◆ OnPointerUpAction

string MoreMountains.InfiniteRunnerEngine.TouchZone.OnPointerUpAction
protected

◆ SendDownEvent

bool MoreMountains.InfiniteRunnerEngine.TouchZone.SendDownEvent = true

should the component send an event when the zone is pressed down ?

◆ SendPressedEvent

bool MoreMountains.InfiniteRunnerEngine.TouchZone.SendPressedEvent = false

should the component send an event when the zone is being pressed ?

◆ SendUpEvent

bool MoreMountains.InfiniteRunnerEngine.TouchZone.SendUpEvent = true

should the component send an event when the zone is pressed up ?

◆ TouchZoneBinding

TouchZoneActions MoreMountains.InfiniteRunnerEngine.TouchZone.TouchZoneBinding

the binding of a possible action


The documentation for this class was generated from the following file:
  • Assets/InfiniteRunnerEngine/Common/Scripts/GUI/TouchZone.cs