public void OnGenerateButtonClick()
 {
     _linesController.ChangeMaxLinesCount(_levelManager.LinesCount);
     foreach (LinePlain lp in _lps)
     {
         _linesController.DrawLine(lp.GetPointsForFullScreen());
     }
     StartCoroutine(StartNewDelayed());
 }
Example #2
0
        private void DrawPlayerLine()
        {
            Vector2 screenStart = Camera.main.WorldToScreenPoint(_start);
            Vector2 startPoint  = new Vector2(screenStart.x / Screen.width, screenStart.y / Screen.height);

            Vector2 screenEnd = Camera.main.WorldToScreenPoint(_end);
            Vector2 endPoint  = new Vector2(screenEnd.x / Screen.width, screenEnd.y / Screen.height);

            if (Vector2.Distance(startPoint, endPoint) > 0.05)
            {
                var lp = new LinePlain(startPoint, endPoint);
                if (_linesController.DrawLine(lp.GetPointsForFullScreen()))
                {
                    _playerLineDrawingSound.Play();
                    _lines.Add(lp);
                    _linesCounter.HideLast();
                }
            }
        }