2024-10-17 15:13:12 +08:00
|
|
|
|
using LTGame;
|
|
|
|
|
|
namespace Gameplay.Vehicle
|
|
|
|
|
|
{
|
|
|
|
|
|
public class BatteryStateAttackEnd : BaseBaterryState
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
private float _waitTime;
|
|
|
|
|
|
|
|
|
|
|
|
public BatteryStateAttackEnd(BaseBattery owner) : base(owner, EBatteryState.AttackEnd)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void _OnEnter(NBaseState exitState,
|
|
|
|
|
|
object param)
|
|
|
|
|
|
{
|
|
|
|
|
|
base._OnEnter(exitState, param);
|
|
|
|
|
|
|
|
|
|
|
|
_waitTime = owner.owner.fightData.attackEndTime;
|
2024-10-22 18:11:17 +08:00
|
|
|
|
_waitTime = _waitTime > 0 ? _waitTime : 0.01f;
|
|
|
|
|
|
owner.owner.statusData.isAttackEnd = true;
|
|
|
|
|
|
owner.owner.statusData.attackEndProgress = 0f;
|
2024-10-17 15:13:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void _OnRunning()
|
|
|
|
|
|
{
|
|
|
|
|
|
base._OnRunning();
|
2024-10-22 18:11:17 +08:00
|
|
|
|
|
|
|
|
|
|
var progress = passTime / _waitTime;
|
|
|
|
|
|
owner.owner.statusData.attackEndProgress = progress;
|
|
|
|
|
|
if (progress >= 1)
|
2024-10-17 15:13:12 +08:00
|
|
|
|
{
|
|
|
|
|
|
isFinished = true;
|
|
|
|
|
|
nextState = EBatteryState.Idle;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-22 18:11:17 +08:00
|
|
|
|
protected override void _OnExit(NBaseState exitState,
|
|
|
|
|
|
object param)
|
|
|
|
|
|
{
|
|
|
|
|
|
base._OnExit(exitState, param);
|
|
|
|
|
|
|
|
|
|
|
|
owner.owner.statusData.isAttackEnd = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-17 15:13:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|