Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 4
0
 // GetCurrentPosition
 private void GetCurrentPosition(Vector2 touchPos)
 {
     defaultPosition   = currentPosition = baseRect.position;
     currentPosition.x = GuiCamera.ScreenToWorldPoint(touchPos).x;
     currentPosition.y = GuiCamera.ScreenToWorldPoint(touchPos).y;
 }
Ejemplo n.º 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);
 }