Exemplo n.º 1
0
    void UpdateCutMouse()
    {
        Vector3 mousePos = Input.mousePosition;

        mousePos.z = z;
        Vector2 newPosition = cam.ScreenToWorldPoint(mousePos);

        rb.position = newPosition;

        velocity = (newPosition - previousPosition).magnitude * Time.deltaTime;

        previousPosition = newPosition;

        actualPosition = newPosition;

        if (timeTouch >= minTimeBlock)
        {
            if (!punchScript.atacou)
            {
                punchScript.Block();
                //print("block");
                CountAndCutBool(false);
            }
        }

        if (velocity > minCutVelocity)
        {
            startCounting = false;
        }
        else
        {
            startCounting = true;
        }
    }
Exemplo n.º 2
0
    IEnumerator WaitForBlock()
    {
        thisPunchScript.Block();
        yield return(new WaitForSeconds(1.3f));

        thisPunchScript.block = false;
    }