Infinite Runner Engine v1.9
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.InfiniteRunnerEngine.ButtonNavigation Class Reference

This class allows keyboard navigation (up and down arrows by default) through a set of buttons More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.ButtonNavigation:

Public Types

enum  AxisChoices { Vertical , Horizontal }
 

Public Member Functions

virtual void MoveMenu (string direction)
 Prevents fast keystrokes and triggers menu movement. More...
 

Public Attributes

List< Button > ButtonList
 the list of buttons the player will be able to navigate through More...
 
float KeyboardSpeed = 0.3f
 the time in second before each new keystroke gets registered, to prevent ultra fast movement between buttons More...
 
AxisChoices Axis
 
bool AutoPressButtonOnFocus =false
 

Protected Member Functions

virtual int MenuSelection (List< Button > buttonList, int currentIndex, string direction)
 Returns a new current index based on the direction the user has input More...
 
virtual void Update ()
 Every frame, checks for input and triggers the MoveMenu method if needed More...
 
virtual void OnGUI ()
 At GUI initialization, sets the focus on the first item More...
 

Protected Attributes

int _selectedIndex = 0
 
float _timeCounter =0f
 
bool _buttonPressRequired = true
 

Detailed Description

This class allows keyboard navigation (up and down arrows by default) through a set of buttons

Member Enumeration Documentation

◆ AxisChoices

Enumerator
Vertical 
Horizontal 

Member Function Documentation

◆ MenuSelection()

virtual int MoreMountains.InfiniteRunnerEngine.ButtonNavigation.MenuSelection ( List< Button >  buttonList,
int  currentIndex,
string  direction 
)
protectedvirtual

Returns a new current index based on the direction the user has input

Returns
The selection.
Parameters
buttonListButton list.
currentIndexCurrent index.
directionDirection.

◆ MoveMenu()

virtual void MoreMountains.InfiniteRunnerEngine.ButtonNavigation.MoveMenu ( string  direction)
virtual

Prevents fast keystrokes and triggers menu movement.

Parameters
directionDirection.

◆ OnGUI()

virtual void MoreMountains.InfiniteRunnerEngine.ButtonNavigation.OnGUI ( )
protectedvirtual

At GUI initialization, sets the focus on the first item

◆ Update()

virtual void MoreMountains.InfiniteRunnerEngine.ButtonNavigation.Update ( )
protectedvirtual

Every frame, checks for input and triggers the MoveMenu method if needed

Member Data Documentation

◆ _buttonPressRequired

bool MoreMountains.InfiniteRunnerEngine.ButtonNavigation._buttonPressRequired = true
protected

◆ _selectedIndex

int MoreMountains.InfiniteRunnerEngine.ButtonNavigation._selectedIndex = 0
protected

◆ _timeCounter

float MoreMountains.InfiniteRunnerEngine.ButtonNavigation._timeCounter =0f
protected

◆ AutoPressButtonOnFocus

bool MoreMountains.InfiniteRunnerEngine.ButtonNavigation.AutoPressButtonOnFocus =false

◆ Axis

AxisChoices MoreMountains.InfiniteRunnerEngine.ButtonNavigation.Axis

◆ ButtonList

List<Button> MoreMountains.InfiniteRunnerEngine.ButtonNavigation.ButtonList

the list of buttons the player will be able to navigate through

◆ KeyboardSpeed

float MoreMountains.InfiniteRunnerEngine.ButtonNavigation.KeyboardSpeed = 0.3f

the time in second before each new keystroke gets registered, to prevent ultra fast movement between buttons


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