using System.Collections; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu(menuName = "Finite State Machine/Action/Investigate")] public class Investigate : Action { [SerializeField] private string timerName; [SerializeField] private float time; public override void Act(FiniteStateMachine fsm) { if (!fsm.floatDictionary.HasKey(timerName)) fsm.floatDictionary.SetValue(timerName, time); if (fsm.GetAgent().IsAtDestination()) { Debug.Log(fsm.animationController.animator); fsm.floatDictionary.SetValue(timerName, fsm.floatDictionary.GetValue(timerName) - Time.deltaTime); fsm.animationController.animator.SetBool("Idle", true); } } }