Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / BlackSmith / Conditions / IsTalking.cs
@Rackday Rackday on 29 Oct 637 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/IsTalking")]
  6. public class IsTalking : Condition
  7. {
  8. public override bool CheckCondition(FSM fsm)
  9. {
  10. InteractableNPC controller = fsm.Controller as InteractableNPC;
  11. if (controller != null)
  12. {
  13. if(controller.DialogueManager.CurrentStory != null)
  14. return true;
  15. return false;
  16. }
  17. Debug.LogError($"Controller is null: {nameof(InteractableNPC)}");
  18. return false;
  19. }
  20. }