Пример #1
0
    void Update()
    {
        if (bulletsAreFlying)
        {
            bostBtn.interactable  = true;
            pauseBtn.interactable = false;
        }
        else
        {
            bostBtn.interactable  = false;
            pauseBtn.interactable = true;
        }

        if (aim)
        {
            endPos = (Vector2)transform.position + (lastMouseClickPos - (Vector2)Input.mousePosition);
            lineRenderer.SetPosition(0, transform.position);
            lineRenderer.SetPosition(0, endPos);
        }
        else
        {
            lineRenderer.SetPosition(0, transform.position);
            lineRenderer.SetPosition(0, transform.position);
        }

        if (Input.GetKeyUp(KeyCode.Mouse0))
        {
            if (aim && !bulletsAreFlying)
            {
                StartCoroutine(StartShooting(playerLevel.GetLevel()));
            }
        }

        SetAim();
    }