31 lines
795 B
C#
31 lines
795 B
C#
using Cysharp.Threading.Tasks;
|
|
|
|
namespace Code.OfficeGame.BattleMode.Actions
|
|
{
|
|
public class BattleActionWait : BattleAction
|
|
{
|
|
private int _waitFrames;
|
|
public override void Tick(float tickDelta)
|
|
{
|
|
_waitFrames--;
|
|
if (_waitFrames <= 0) Finished = true;
|
|
}
|
|
|
|
public override async UniTask<BattleActionDecisionResult> DecideAction()
|
|
{
|
|
Finished = false;
|
|
|
|
await UniTask.Yield();
|
|
|
|
_waitFrames = 120;
|
|
|
|
return new()
|
|
{
|
|
ResultCode = BattleActionDecisionResultCode.Decided,
|
|
FrameDuration = _waitFrames
|
|
};
|
|
}
|
|
|
|
public override BattleActionType ActionType => BattleActionType.Wait;
|
|
}
|
|
} |