Exemple #1
0
    public void BeginSkill(int playerIdx, int skillID, int attackID)
    {
        if (isEnd)
        {
            return;
        }
        SKILL skill = DataCfgMgr.instance.GetSkill(skillID);

        if (skill == null)
        {
            return;
        }
        Type skillTemplate = null;

        if (!mSkillTemplateMap.TryGetValue(skill.template, out skillTemplate))
        {
            return;
        }
        SkillBase skillInst = GetSkillFromPool(skill.template);

        if (skillInst == null)
        {
            skillInst = Activator.CreateInstance(skillTemplate) as SkillBase;
        }

        if (skillInst.Begin(playerIdx, skillID, attackID, skill.template))
        {
            mSkillInsts.Add(skillInst);
        }
    }