Esempio n. 1
0
    public void Update()
    {
        if (!inputHandler.IsTouched)
        {
            return;
        }

        float normalPosition = Mathf.InverseLerp(leftBorder, rightBorder, inputHandler.TouchPosition.x);

        racketController.SetTargetPosition(normalPosition);
    }
Esempio n. 2
0
    public void Update()
    {
        if (!isBallMovedToMe)
        {
            return;
        }

        float position       = ballTransform.position.x;
        float normalPosition = Mathf.InverseLerp(-border, border, position);

        racketController.SetTargetPosition(normalPosition);
    }