Пример #1
0
    public override bool IsSkillCanBreak(SkillNode node, SkillCategory category)
    {
        if (m_CurSkillNode == null)
        {
            return(true);
        }
        IShooterSkill skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null || !skill.IsExecuting())
        {
            return(true);
        }
        if (category != SkillCategory.kNone)
        {
            if (m_CurSkillNode.Category == SkillCategory.kAttack &&
                category == SkillCategory.kAttack &&
                m_CurSkillNode.NextSkillNode != null)
            {
                return(false);
            }
            else if (m_CurSkillNode.Category != SkillCategory.kAttack &&
                     category == SkillCategory.kAttack)
            {
                return(skill.CanBreak());
            }
            else
            {
                return(skill.CanBreakBySkill());
            }
        }
        return(skill.CanBreak());
    }
Пример #2
0
    public bool StartSkillById(int skillid, Vector3 targetPos)
    {
        IShooterSkill ss = GetSkillById(skillid);

        if (ss == null)
        {
            return(false);
        }
        if (m_CurPlaySkill == null || m_CurPlaySkill.CanBreakBySkill() && ss.CanStart())
        {
            if (m_CurPlaySkill != null)
            {
                m_CurPlaySkill.StopSkill();
            }
            if (ss.StartSkill(targetPos))
            {
                m_CurPlaySkill = ss;
                return(true);
            }
        }
        return(false);
    }