예제 #1
0
파일: Parry.cs 프로젝트: Maxpaximus/Grupp4
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.X) && laser.currentEnergy > 24)
        {
            parry();
            laser.TakeParryEnergy();
            parryActive = true;
            lastParry   = Time.time;
        }
        else
        {
            parryActive = false;
        }


        if (parryActive && Time.time - lastParry < parryTime)
        {
            sphereMesh.enabled     = true;
            circleCollider.enabled = true;
            parryActive            = true;
        }
        else if (Time.time - lastParry > parryTime)
        {
            sphereMesh.enabled     = false;
            circleCollider.enabled = false;
            damageScript.NotParried();
        }
    }