示例#1
0
    public override bool IsSkillCanStart(SkillNode node)
    {
        if (node == null)
        {
            return(false);
        }
        IShooterSkill skill = m_SkillManager.GetSkillById(node.SkillId);

        if (skill == null)
        {
            return(false);
        }
        return(skill.CanStart());
    }
示例#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);
    }
示例#3
0
    public bool ForceStartSkillById(int skillid)
    {
        IShooterSkill ss = GetSkillById(skillid);

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