54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using Gameplay.Skill;
|
|
using Gameplay.Unit;
|
|
|
|
namespace Gameplay.Character.Skill
|
|
{
|
|
public abstract class CharacterSkillAction
|
|
{
|
|
public bool isTriggered;
|
|
public float triggerTime;
|
|
public ISkillState skill;
|
|
public SkillLogicActionData actionData;
|
|
|
|
public List<int> preSelectCellIndexs;
|
|
public List<GameUnit> preSelectUnits;
|
|
|
|
public void Prepare()
|
|
{
|
|
isTriggered = false;
|
|
_OnPrepare();
|
|
}
|
|
|
|
protected virtual void _OnPrepare()
|
|
{
|
|
|
|
}
|
|
|
|
public void LogicUpdate(float currentPassTime)
|
|
{
|
|
// 外部保证
|
|
// if (isTriggered) return;
|
|
if (currentPassTime < triggerTime)
|
|
{
|
|
return;
|
|
}
|
|
isTriggered = true;
|
|
|
|
// 触发技能
|
|
_Trigger();
|
|
|
|
}
|
|
|
|
private void _Trigger()
|
|
{
|
|
_OnTrigger();
|
|
}
|
|
|
|
protected virtual void _OnTrigger()
|
|
{
|
|
}
|
|
|
|
}
|
|
}
|