Exemple #1
0
    private void UpdateAfterSkillAutoAttack()
    {
        if (m_WaiteSkillBuffer.Count > 0)
        {
            return;
        }

        if (m_CurSkillNode != null)
        {
            if (Time.time > GetWaitInputTime(m_CurSkillNode))
            {
                return;
            }
            IShooterSkill ss         = m_SkillManager.GetSkillById(m_CurSkillNode.SkillId);
            SkillNode     attackNode = m_SkillCategoryDict[SkillCategory.kAttack];
            if (ss != null && ss.IsAttackAfterSkill() &&
                attackNode != null && IsSkillCanBreak(m_CurSkillNode, attackNode.Category) &&
                m_WaiteSkillBuffer.Count == 0)
            {
                Vector3 targetPos;
                if (TriggerImpl.GetCurTargetPos(m_SkillManager.GetOwner(), out targetPos))
                {
                    SkillInputData data = GetSkillInputData(SkillCategory.kAttack);
                    if (data != null && Vector3.Magnitude(targetPos - m_SkillManager.GetOwner().transform.position) <= data.castRange)
                    {
                        StartAttack(targetPos);
                    }
                }
            }
        }
    }