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

[CreateAssetMenu(menuName = "Finite State Machine/Action/Interact")]
public class InteractAction : Action
{
    public override void Run(FSM fsm)
    {
        if (Input.GetKeyDown(InputManager.GetKey(InputAction.Interact)))
        {
            InteractableNPC controller = fsm.Controller as InteractableNPC;

            if(controller != null)
            {
                controller.OnInteract();
            }
        }
    }
}