private void JoyMouseManagment( UMJDemo_Joystick Joystick ) { if ( Joystick.CheckPosition ( Input.mousePosition.x, Input.mousePosition.y ) && Input.GetMouseButtonDown( 0 ) ) { Joystick.TouchDown = true; Joystick.GetDefaultPosition ( Input.mousePosition.x, Input.mousePosition.y ); } if ( Joystick.TouchDown && Input.GetMouseButton( 0 ) ) Joystick.GetCurrentPosition ( Input.mousePosition.x, Input.mousePosition.y ); if ( Input.GetMouseButtonUp( 0 ) ) Joystick.ResetJoystickPosition(); }
private void JoyMouseManagment(UMJDemo_Joystick Joystick) { if (Joystick.CheckPosition(Input.mousePosition.x, Input.mousePosition.y) && Input.GetMouseButtonDown(0)) { Joystick.TouchDown = true; Joystick.GetDefaultPosition(Input.mousePosition.x, Input.mousePosition.y); } if (Joystick.TouchDown && Input.GetMouseButton(0)) { Joystick.GetCurrentPosition(Input.mousePosition.x, Input.mousePosition.y); } if (Input.GetMouseButtonUp(0)) { Joystick.ResetJoystickPosition(); } }
private void JoyTouchManagment(Touch touch, UMJDemo_Joystick Joystick) { switch (touch.phase) { case TouchPhase.Began: if (Joystick.CheckPosition(touch.position.x, touch.position.y) && !Joystick.TouchDown) { Joystick.TouchID = touch.fingerId; Joystick.TouchDown = true; Joystick.GetDefaultPosition(touch.position.x, touch.position.y); } break; case TouchPhase.Stationary: case TouchPhase.Moved: if (Joystick.TouchID == touch.fingerId && Joystick.TouchDown) { Joystick.GetCurrentPosition(touch.position.x, touch.position.y); } break; case TouchPhase.Ended: case TouchPhase.Canceled: if (Joystick.TouchID == touch.fingerId) { Joystick.ResetJoystickPosition(); } break; } }
private void JoyTouchManagment( Touch touch, UMJDemo_Joystick Joystick ) { switch ( touch.phase ) { case TouchPhase.Began: if ( Joystick.CheckPosition ( touch.position.x, touch.position.y ) && !Joystick.TouchDown ) { Joystick.TouchID = touch.fingerId; Joystick.TouchDown = true; Joystick.GetDefaultPosition( touch.position.x, touch.position.y ); } break; case TouchPhase.Stationary: case TouchPhase.Moved: if ( Joystick.TouchID == touch.fingerId && Joystick.TouchDown ) { Joystick.GetCurrentPosition( touch.position.x, touch.position.y ); } break; case TouchPhase.Ended: case TouchPhase.Canceled: if ( Joystick.TouchID == touch.fingerId ) { //Joystick.ResetJoystickPosition(); } break; } }