Esempio n. 1
0
 private void StartDraw()
 {
     _lineRenderer.gameObject.SetActive(true);
     _pointBegin.SetActive(false);
     _pointEnd.SetActive(false);
     _drawPoints.Clear();
     this.StartCoroutine(ref _coroutineDraw, Co_Draw());
     OnChangeDrawState?.Invoke(true);
 }
Esempio n. 2
0
    private void FinishDraw()
    {
        _lineRenderer.gameObject.SetActive(false);
        _pointBegin.SetActive(false);
        _pointEnd.SetActive(false);
        this.StopCoroutine(ref _coroutineDraw);
        var center = _drawPoints[0];
        var scale  = new Vector2(_ratio, 1f).normalized;

        OnChangeDrawState?.Invoke(false);
        OnChangeArmPoints?.Invoke(_drawPoints.Select(p => Vector2.Scale(p - center, scale)).ToList());
    }