using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Moloch { public class IdleState : BaseState { private LocomotionSM m_SM; private float m_Duration; public IdleState(LocomotionSM machine) : base("Idle", machine) { m_SM = machine; } public override void Enter() { base.Enter(); // Set the idle animation m_Duration = 2f; } public override void UpdateLogic() { base.UpdateLogic(); // Set a timer if (m_Duration > 0f) { //Debug.Log($"Couting Down {m_Duration}"); m_Duration -= Time.fixedDeltaTime; } else { Debug.Log($"Switching state to {m_SM.m_wanderState.m_Name}"); m_SM.SwitchState(m_SM.m_wanderState); } } } }