Beispiel #1
0
    IEnumerator Parry()
    {
        if (CanParry())
        {
            if (currentParryState == ParryState.None)
            {
                playerAnim.Play("Parry");
                CustomFunctions.PlaySound(parryBubbleSound);
                currentParryState = ParryState.IsParrying;
                parryCircle.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f);
                while (parryCircle.transform.localScale.x > 0)
                {
                    parryCircle.transform.localScale -= new Vector3(0.01f, 0.01f, 0.01f) * Mathf.Exp(1.5f - parryCircle.transform.localScale.x);
                    yield return(new WaitForSeconds(0.01f));
                }
            }

            if (parryCircle.transform.localScale.x <= 0)
            {
                //print("DONE");
                currentParryState = ParryState.ParryCooldown;
                if (parryWasSuccessful == false)
                {
                    yield return(new WaitForSeconds(0.2f));
                }

                StopParry();
            }
        }

        yield break;
    }
Beispiel #2
0
 public void StopParry()
 {
     currentParryState = ParryState.None;
     parryCircle.transform.localScale = Vector3.zero;
     if (currentHealth > 0)
     {
         playerAnim.Play("Idle");
     }
 }