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(); } } } }