整理武器配置和重构
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using SepCore.AsyncTask;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Entity;
|
||||
using SepCore.Timer;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class EnemyBase : TargetableObject
|
||||
@@ -16,29 +15,6 @@ public abstract class EnemyBase : TargetableObject
|
||||
|
||||
protected EnemyData _enemyData;
|
||||
|
||||
protected bool _canAttack;
|
||||
protected TimerHandle _attackTimerHandle;
|
||||
|
||||
protected void StartAttackCooldown(float cooldown)
|
||||
{
|
||||
_canAttack = false;
|
||||
_attackTimerHandle = GameEntry.Timer.ScheduleOnce(cooldown, () => _canAttack = true, this);
|
||||
}
|
||||
|
||||
protected void ResetAttackCooldown(float cooldown)
|
||||
{
|
||||
GameEntry.Timer.Cancel(_attackTimerHandle);
|
||||
_canAttack = false;
|
||||
_attackTimerHandle = GameEntry.Timer.ScheduleOnce(cooldown, () => _canAttack = true, this);
|
||||
}
|
||||
|
||||
protected void CancelAttackCooldown()
|
||||
{
|
||||
GameEntry.Timer.Cancel(_attackTimerHandle);
|
||||
_attackTimerHandle = TimerHandle.Invalid;
|
||||
_canAttack = false;
|
||||
}
|
||||
|
||||
protected override void OnShow(object userData)
|
||||
{
|
||||
base.OnShow(userData);
|
||||
|
||||
Reference in New Issue
Block a user