Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / BlackSmith / Conditions / NotTalking.cs
@Rackday Rackday on 29 Oct 589 bytes Major Update
  1. using MyCollections.AI.FinitStateMachine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. [CreateAssetMenu(menuName = "Finite State Machine/Condition/IsNotTalking")]
  6. public class NotTalking : Condition
  7. {
  8. public override bool CheckCondition(FSM fsm)
  9. {
  10. InteractableNPC controller = fsm.Controller as InteractableNPC;
  11. if (controller != null)
  12. {
  13. return controller.DialogueManager.CurrentStory == null;
  14. }
  15. Debug.LogError($"Controller is null: {nameof(InteractableNPC)}");
  16. return false;
  17. }
  18. }