public override IEnumerator Dispatch(FightBehaviour context) { context.isOcurring = true; float chance = UnityEngine.Random.Range(0, 1); if (chance >= minimumChanceToAttackPlayer) { battler.Attack(); // Wait Until We Trigger Attack Animation yield return(new WaitUntil(() => battler.IsAttacking() == true)); // Now Wait Until Attack Animation Is Over yield return(new WaitUntil(() => battler.IsAttacking() == false)); } else { battler.Defend(); // Wait Until We Trigger Attack Animation yield return(new WaitUntil(() => battler.IsDefending() == true)); // Now Wait Until Attack Animation Is Over yield return(new WaitUntil(() => battler.IsDefending() == false)); } context.isOcurring = false; }
public override IEnumerator Dispatch(FightBehaviour context) { battler.Attack(); // Wait Until We Trigger Attack Animation yield return(new WaitUntil(() => battler.IsAttacking() == true)); // Now Wait Until Attack Animation Is Over yield return(new WaitUntil(() => battler.IsAttacking() == false)); }
public override IEnumerator Dispatch(FightBehaviour context) { context.isOcurring = true; battler.Defend(); // Wait Until We Trigger Attack Animation yield return(new WaitUntil(() => battler.IsDefending() == true)); // Now Wait Until Attack Animation Is Over yield return(new WaitUntil(() => battler.IsDefending() == false)); context.isOcurring = false; }
public virtual IEnumerator Dispatch(FightBehaviour context) { yield return(null); }
public override IEnumerator Dispatch(FightBehaviour context) { StartCoroutine(customBehaviour.Dispatch(context)); yield return(null); }