- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [CreateAssetMenu(menuName = "Finite State Machine/Condition/Or Condition")]
- public class OrCondition : Condition
- {
- public List<Condition> orConditions;
- protected override bool Test(FiniteStateMachine fsm)
- {
- bool result = false;
- if (orConditions != null)
- {
- foreach (Condition condition in orConditions)
- {
- result = (condition != null && condition.DoTest(fsm));
- if (result)
- {
- return true;
- }
- }
- }
- return false;
-
- }
- }