Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.TouchButton Class Reference

An input button typically used for mobile devices. More...

Inheritance diagram for PlatformerPro.TouchButton:
PlatformerPro.ITouchButton PlatformerPro.TouchButtonExit

Public Member Functions

virtual void OnButtonStateChanged ()
 Raises the button state changed event. More...
 

Public Attributes

bool touchMustStartInButton
 The touch must start in button. More...
 
Camera inputCamera
 Camera being used to draw the input UI. More...
 

Protected Member Functions

virtual void Init ()
 Init this instance. More...
 
virtual void UpdateFingerState ()
 Updates the state of the button based on fingers. More...
 
virtual void Released ()
 Called when this this instance. More...
 

Protected Attributes

ButtonState buttonState = ButtonState.NONE
 The last state. More...
 
int fingerId = -1
 If this button was down or held which finger was doing the holding. More...
 
Collider2D myCollider
 Cached collider for this button. More...
 
ButtonEventArgs buttonEventArgs
 A cached button event args that we update so we don't need to allocate. More...
 

Properties

virtual ButtonState ButtonState [get]
 Gets the state of the button. More...
 
- Properties inherited from PlatformerPro.ITouchButton
ButtonState ButtonState [get]
 Gets the state of the button. More...
 

Events

System.EventHandler< ButtonEventArgsButtonStateChanged
 Occurs when button state changes. Note that arguments are not a copy to avoid allocation. More...
 

Detailed Description

An input button typically used for mobile devices.

Member Function Documentation

◆ Init()

virtual void PlatformerPro.TouchButton.Init ( )
protectedvirtual

Init this instance.

◆ OnButtonStateChanged()

virtual void PlatformerPro.TouchButton.OnButtonStateChanged ( )
virtual

Raises the button state changed event.

◆ Released()

virtual void PlatformerPro.TouchButton.Released ( )
protectedvirtual

Called when this this instance.

Reimplemented in PlatformerPro.TouchButtonExit.

◆ UpdateFingerState()

virtual void PlatformerPro.TouchButton.UpdateFingerState ( )
protectedvirtual

Updates the state of the button based on fingers.

Member Data Documentation

◆ buttonEventArgs

ButtonEventArgs PlatformerPro.TouchButton.buttonEventArgs
protected

A cached button event args that we update so we don't need to allocate.

◆ buttonState

ButtonState PlatformerPro.TouchButton.buttonState = ButtonState.NONE
protected

The last state.

◆ fingerId

int PlatformerPro.TouchButton.fingerId = -1
protected

If this button was down or held which finger was doing the holding.

◆ inputCamera

Camera PlatformerPro.TouchButton.inputCamera

Camera being used to draw the input UI.

◆ myCollider

Collider2D PlatformerPro.TouchButton.myCollider
protected

Cached collider for this button.

◆ touchMustStartInButton

bool PlatformerPro.TouchButton.touchMustStartInButton

The touch must start in button.

Property Documentation

◆ ButtonState

virtual ButtonState PlatformerPro.TouchButton.ButtonState
get

Gets the state of the button.

Event Documentation

◆ ButtonStateChanged

System.EventHandler<ButtonEventArgs> PlatformerPro.TouchButton.ButtonStateChanged

Occurs when button state changes. Note that arguments are not a copy to avoid allocation.


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