2025-10-28 17:26:07 +00:00
|
|
|
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;
|
|
|
|
|
}
|
2025-10-30 16:50:35 +00:00
|
|
|
public void CancelCurrentAction()
|
|
|
|
|
{
|
|
|
|
|
StartAction(null);
|
|
|
|
|
}
|
2025-10-28 17:26:07 +00:00
|
|
|
}
|
|
|
|
|
}
|