Infinite Runner Engine v2.2
Loading...
Searching...
No Matches
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.

Public Attributes

List< Button > ButtonList
 the list of buttons the player will be able to navigate through
float KeyboardSpeed = 0.3f
 the time in second before each new keystroke gets registered, to prevent ultra fast movement between buttons
AxisChoices Axis
 the axis to use for navigation
bool AutoPressButtonOnFocus = false
 if set to true, the first button will be automatically selected

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.
virtual void Update ()
 Every frame, checks for input and triggers the MoveMenu method if needed.
virtual void OnGUI ()
 At GUI initialization, sets the focus on the first item.

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

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

if set to true, the first button will be automatically selected

◆ Axis

AxisChoices MoreMountains.InfiniteRunnerEngine.ButtonNavigation.Axis

the axis to use for navigation

◆ 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: