Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / AI / Navmesh / Conditions / OrCondition.cs
@Rackday Rackday on 21 Aug 678 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. [CreateAssetMenu(menuName = "Finite State Machine/Condition/Or Condition")]
  5. public class OrCondition : Condition
  6. {
  7. public List<Condition> orConditions;
  8. protected override bool Test(FiniteStateMachine fsm)
  9. {
  10. bool result = false;
  11. if (orConditions != null)
  12. {
  13. foreach (Condition condition in orConditions)
  14. {
  15. result = (condition != null && condition.DoTest(fsm));
  16. if (result)
  17. {
  18. return true;
  19. }
  20. }
  21. }
  22. return false;
  23. }
  24. }