InControl.InputControl.UpdateWithValue C# (CSharp) Method

UpdateWithValue() public method

public UpdateWithValue ( float value, ulong updateTick ) : void
value float
updateTick ulong
return void
        public void UpdateWithValue( float value, 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." );
            }

            if (Mathf.Abs( value ) > Mathf.Abs( tempState.Value )) {
            tempState.Set( value );
            }
        }

Usage Example

Example #1
0
 protected void SubmitButtonValue(ButtonTarget target, float value, ulong updateTick, float deltaTime)
 {
     if (TouchManager.Device != null && target != 0)
     {
         InputControl control = TouchManager.Device.GetControl((InputControlType)target);
         if (control != null && control != InputControl.Null)
         {
             control.UpdateWithValue(value, updateTick, deltaTime);
         }
     }
 }
All Usage Examples Of InControl.InputControl::UpdateWithValue