public override void Update(float deltaTime) { if (m_castPoint < -1f) //达到了castPoint之后 { if (isChannel) { if (m_channelTime < -1f) { } else if (m_channelTime < 0f) { m_channelTime = -2f; caster.TriggerAbilityEvent(AbilityEventType.OnChannelFinish); caster.TriggerAbilityEvent(AbilityEventType.OnChannelSucceeded); //引导技能完毕之后 EndChannel(); } else //引导中 { m_channelTime -= deltaTime; m_channelInterval -= deltaTime; if (m_channelInterval < 0f) { m_channelInterval = abilityParams.channelThink; OnChannelThink(); } } } } else if (m_castPoint < 0f) //开始释放技能之后,m_castPoint之前 { m_castPoint = -2f; caster.TriggerAbilityEvent(AbilityEventType.OnSpellStart); caster.TriggerModifierEvent(ModifierEventType.OnAbilityStart); if (isChannel) { m_channelTime = abilityParams.channelTime; } } else { m_castPoint -= deltaTime; } if (duration < -1f) //没有在释放技能的过程中 { if (coolDown < -1f) //没有在冷却中 { } else if (coolDown < 0f) //刚刚冷却完成 { coolDown = -2f; } //开始冷却 else { coolDown -= deltaTime; } } else if (duration < 0f) //技能刚刚释放完毕 { duration = -2f; coolDown = abilityParams.coolDown; } //开始冷却 else { duration -= deltaTime; } }