示例#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);
 }