예제 #1
0
    private float GetPaddleXPosition()
    {
        // If the ball has been destroyed, we need to find it again!
        if (ball != null)
        {
            if (gameSession.IsAutoPlayEnabled() && ball.HasGameStarted())
            {
                return(ball.transform.position.x);
            }
            else
            {
                return(screenWidthUnits * Input.mousePosition.x / Screen.width);
            }
        }
        else
        {
            ball = FindObjectOfType <BlackHole>();

            return(screenWidthUnits * Input.mousePosition.x / Screen.width);
        }
    }