Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / AI / FSM / Condition.cs
@Rackday Rackday on 21 Aug 2024 403 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public abstract class Condition : ScriptableObject
  5. {
  6. public bool negate;
  7. protected abstract bool Test(FiniteStateMachine fsm);
  8. public bool DoTest(FiniteStateMachine fsm)
  9. {
  10. if (negate)
  11. {
  12. return !Test(fsm);
  13. } else
  14. {
  15. return Test(fsm);
  16. }
  17. }
  18. }