static class BtnStateExtensions

A collection of extension methods for the BtnState enum that makes bit-field checks a little easier.

Static Methods

   
IsActive Is the button pressed?
IsChanged Was the button either presses or released this frame?
IsJustActive Has the button just been pressed this frame?
IsJustInactive Has the button just been released this frame?

Examples

BtnState state = Input.Hand(Handed.Right).pinch;

// You can check a BtnState using bit-flag logic
if ((state & BtnState.Changed) > 0)
	Log.Info("Pinch state just changed!");

// Or you can check the same values with the extension methods, no
// bit flag logic :)
if (state.IsChanged())
	Log.Info("Pinch state just changed!");




Found an issue with these docs, or have some additional questions? Create an Issue on Github!