You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
956 B

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