/** * @param buttonIdx (One-indexed button). '1' for button1 (first button). * @return true if specified button is true. */ public bool GetButton(uint buttonIdx) { if (buttonIdx > 0) { --buttonIdx; } _provider.Get(ref _values, _index); return((_values.btns >> (int)buttonIdx & 1) == 1); }
/** * @param buttonIdx (One-indexed button). '1' for button1 (first button). * @return true if specified button is true. */ public bool GetButton(uint buttonIdx) { if (buttonIdx == 0) { Reporting.Log(ErrorCode.InvalidParamValue, AbstractLocalGamepad.Button0Error, 0, ""); return(false); } if (buttonIdx > 0) { --buttonIdx; } _provider.Get(ref _values, _index); return((_values.btns >> (int)buttonIdx & 1) == 1); }