예제 #1
0
 /// <summary>
 /// 与虚拟按键绑定
 /// </summary>
 /// <param name="button"></param>
 public virtual void ConnectWith(IVirtualButton button)
 {
     if (button == null)
     {
         return;
     }
     _virtualButton = button;
     _incompatibleWithRealButton  = _virtualButton.IncompatibleWithRealButton;
     button.IsConnectedWithButton = true;
     button.ConnectedWith         = this;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualButtonBinding" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="button">The button.</param>
 public VirtualButtonBinding(object name, IVirtualButton button = null)
 {
     Name   = name;
     Button = button;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualButtonTwoWay" /> class.
 /// </summary>
 /// <param name="negativeButton">The negative button.</param>
 /// <param name="positiveButton">The positive button.</param>
 public VirtualButtonTwoWay(IVirtualButton negativeButton, IVirtualButton positiveButton)
 {
     NegativeButton = negativeButton;
     PositiveButton = positiveButton;
 }
예제 #4
0
 public VirtualButtonBindingExt(
     object name, IVirtualButton button, params IVirtualButtonValueTransform[] transforms)
     : base(name, button)
 {
     _transforms = transforms;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualButtonBinding" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="button">The button.</param>
 public VirtualButtonBinding(object name, IVirtualButton button = null)
 {
     Name = name;
     Button = button;
 }
예제 #6
0
 /// <summary>
 /// 解除与虚拟按键的绑定
 /// </summary>
 public virtual void Disconnect()
 {
     _virtualButton = null;
     _incompatibleWithRealButton = false;
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualButtonTwoWay" /> class.
 /// </summary>
 /// <param name="negativeButton">The negative button.</param>
 /// <param name="positiveButton">The positive button.</param>
 public VirtualButtonTwoWay(IVirtualButton negativeButton, IVirtualButton positiveButton)
 {
     NegativeButton = negativeButton;
     PositiveButton = positiveButton;
 }
예제 #8
0
 public VirtualJoystick(IVirtualButton joystick, float deadZone = 0f)
 {
     this.joystick = joystick;
     this.deadZone = deadZone;
 }
예제 #9
0
 public VirtualMouseAxis(IVirtualButton mouseAxis, bool negative = false, float mouseSensitivity = 100f)
 {
     this.mouseAxis        = mouseAxis;
     this.mouseSensitivity = mouseSensitivity;
     this.negative         = negative;
 }