Exemplo n.º 1
0
    void Update()
    {
        Vector2 mousePosition = mainCamera.ScreenToWorldPoint(Input.mousePosition);

        if (levelManager.CurrentLevelState == LevelState.WAITING)
        {
            trajectoryRenderer.SetTrajectoryPoints(mousePosition);
            trajectoryRenderer.DrawDots();

            if (Input.GetKeyDown(KeyCode.Space))
            {
                ballLauncher.LaunchBalls(mousePosition);
            }
        }
    }
Exemplo n.º 2
0
 void Update()
 {
     if (levelManager.CurrentLevelState == LevelState.WAITING)
     {
         if (Input.touchCount > 0)
         {
             Touch   touch         = Input.GetTouch(0);
             Vector3 touchPosition = mainCamera.ScreenToWorldPoint(touch.position);
             touchPosition.y = Mathf.Clamp(touchPosition.y, -3.1f, 10f);
             trajectoryRenderer.SetTrajectoryPoints(touchPosition);
             trajectoryRenderer.DrawDots();
             if (touch.phase == TouchPhase.Ended)
             {
                 ballLauncher.LaunchBalls(touchPosition);
             }
         }
     }
 }