コード例 #1
0
 // Get CurrentPosition
 private void GetCurrentPosition(Vector2 touchPos)
 {
     defaultPosition = currentPosition = joystickBackgroundRT.position;
     if (axisX.enabled)
     {
         currentPosition.x = GuiCamera.ScreenToWorldPoint(touchPos).x;
     }
     if (axisY.enabled)
     {
         currentPosition.y = GuiCamera.ScreenToWorldPoint(touchPos).y;
     }
 }
コード例 #2
0
        // GetCurrent Position
        protected void GetCurrentPosition(Vector2 touchPos)
        {
            if (axisX.enabled)
            {
                currentPosition.x = GuiCamera.ScreenToWorldPoint(touchPos).x;
            }
            if (axisY.enabled)
            {
                currentPosition.y = GuiCamera.ScreenToWorldPoint(touchPos).y;
            }

            sizeX           = baseRect.sizeDelta.x / 2f;
            sizeY           = baseRect.sizeDelta.y / 2f;
            defaultPosition = baseRect.position;
        }
コード例 #3
0
        // Get CurrentPosition
        private void UpdateCurrentPosition(Vector2 touchPos)
        {
            defaultPosition = currentPosition = backgroundRT.position;

            Vector2 worldPoint = GuiCamera.ScreenToWorldPoint(touchPos);

            if (axisX.enabled)
            {
                currentPosition.x = worldPoint.x;
            }
            if (axisY.enabled)
            {
                currentPosition.y = worldPoint.y;
            }
        }
コード例 #4
0
 // GetCurrentPosition
 private void GetCurrentPosition(Vector2 touchPos)
 {
     defaultPosition   = currentPosition = baseRect.position;
     currentPosition.x = GuiCamera.ScreenToWorldPoint(touchPos).x;
     currentPosition.y = GuiCamera.ScreenToWorldPoint(touchPos).y;
 }
コード例 #5
0
 // Update Transparency and Position for DynamicJoystick
 private void UpdateTransparencyAndPosition(Vector2 touchPos)
 {
     OnApplyVisible();
     joystickImage.enabled = backgroundImage.enabled = true;
     joystickRT.position   = backgroundRT.position = GuiCamera.ScreenToWorldPoint(touchPos);
 }