public void RegisterMouseButton(TInputId button, SPMouseId spbtn) { _buttonTable[button] = InputToken.CreateButton(spbtn.ToSPInputId()); _axisTable.Remove(button); }
private System.Collections.IEnumerator WorkRoutine(float delay) { yield return(WaitForDuration.Seconds(delay, SPTime.Real)); while (_state == State.Running) { if (UnityEngine.Input.GetKeyDown(this.CancelKey)) { this.Cancel(); yield break; } if (this.CancelDelegate != null && this.CancelDelegate()) { this.Cancel(); yield break; } if (this.CustomPollingCallback != null) { InputToken t; if (this.CustomPollingCallback(this, out t)) { this.InputResult = t; goto Complete; } } if (this.PollFromStandardSPInputs) { if (this.PollButtons) { SPInputId btn; if (SPInputDirect.TryPollButton(out btn, this.ButtonPollingState, this.Joystick)) { this.InputResult = InputToken.CreateButton(btn); goto Complete; } } if (this.PollJoyAxes || this.PollMouseAxes) { SPInputId axis; float value; if (SPInputDirect.TryPollAxis(out axis, out value, this.Joystick, this.PollMouseAxes, this.AxisPollingDeadZone) && TestConsideration(value, this.AxisConsideration, this.AxisPollingDeadZone)) { if ((this.PollJoyAxes && axis.IsJoyAxis()) || (this.PollMouseAxes && axis.IsMouseAxis())) { this.InputResult = InputToken.CreateAxleButton(axis, this.AxisConsideration, this.AxisPollingDeadZone); goto Complete; } } } } if (this.PollKeyboard) { UnityEngine.KeyCode key; if (SPInputDirect.TryPollKey(out key, this.ButtonPollingState)) { this.InputResult = InputToken.CreateButton(key); goto Complete; } } yield return(null); } Complete: _state = State.Complete; _routine = null; this.SignalOnComplete(); }
public void RegisterButton(TInputId button, KeyCode key) { _buttonTable[button] = InputToken.CreateButton(key); _axisTable.Remove(button); }