InControl.InputControl.UpdateWithState C# (CSharp) Method

UpdateWithState() public method

public UpdateWithState ( bool state, ulong updateTick ) : void
state bool
updateTick ulong
return void
        public void UpdateWithState( bool state, ulong updateTick )
        {
            if (IsNull) {
            throw new InvalidOperationException( "A null control cannot be updated." );
            }

            if (UpdateTick > updateTick) {
            throw new InvalidOperationException( "A control cannot be updated with an earlier tick." );
            }

            tempState.Set( state || tempState.State );
        }

Usage Example

Example #1
0
 protected void SubmitButtonState(ButtonTarget target, bool state, ulong updateTick, float deltaTime)
 {
     if (TouchManager.Device != null && target != 0)
     {
         InputControl control = TouchManager.Device.GetControl((InputControlType)target);
         if (control != null && control != InputControl.Null)
         {
             control.UpdateWithState(state, updateTick, deltaTime);
         }
     }
 }