22 lines
487 B
C#
22 lines
487 B
C#
using UnityEngine;
|
|
|
|
namespace RPG.Core
|
|
{
|
|
public class ActionScheduler : MonoBehaviour
|
|
{
|
|
IAction currentAction;
|
|
public void StartAction(IAction action)
|
|
{
|
|
if (currentAction == action) return;
|
|
if (currentAction != null)
|
|
{
|
|
currentAction.Cancel();
|
|
}
|
|
currentAction = action;
|
|
}
|
|
public void CancelCurrentAction()
|
|
{
|
|
StartAction(null);
|
|
}
|
|
}
|
|
} |