public override IEnumerator Start() { yield return(new WaitUntil(() => !(abilityIndex is null))); if (abilityIndex != null && player.GetAllAbilitys[abilityIndex.Value].abilityType is AbilityTypes.Heal) { player.AddTarget(player.gameObject); player.SetChooseAbility(abilityIndex.Value); player.stateMachine.SetState(new QueueActions(BattleManager)); yield break; } if (abilityIndex != null) { player.SetChooseAbility(abilityIndex.Value); } yield return(new WaitForSeconds(0.2f)); player.stateMachine.SetState(new SelectingTarget(BattleManager)); BattleManager.OnSelectAbility -= HandleSelectAbility; BattleManager.onWon.RemoveListener(HandleEndBattle); BattleManager.onLos.RemoveListener(HandleEndBattle); }
public override IEnumerator Start() { yield return(new WaitUntil(() => !(target is null))); player.AddTarget(target); player.stateMachine.SetState(new QueueActions(BattleManager)); yield return(null); BattleManager.OnSelectTarget -= HandleSelectTarget; }