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 preSelectCellIndexs; public List 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() { } } }