Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / BlackSmith / Conditions / IsTalking.cs
@Rackday Rackday on 29 Oct 637 bytes Major Update
using MyCollections.AI.FinitStateMachine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName = "Finite State Machine/Condition/IsTalking")]
public class IsTalking : Condition
{
    public override bool CheckCondition(FSM fsm)
    {
        InteractableNPC controller = fsm.Controller as InteractableNPC;

        if (controller != null)
        {
            if(controller.DialogueManager.CurrentStory != null)
                return true;

            return false;
        }

        Debug.LogError($"Controller is null: {nameof(InteractableNPC)}");
        return false;
    }
}