Пример #1
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (GameLibrary.IsMajorOrLogin())
     {
         return;
     }
     base.OnStateEnter(animator, stateInfo, layerIndex);
     GetSkillNodeByStateInfo(stateInfo);
     pm.canAttack = false;
     pm.canSkill  = false;
     pm.canMoveSwitch++;
     pm.canAttackSwitch++;
     pm.canSkillSwitch++;
     mSkillTouchIndex = 0;
     mIsStateStart    = true;
     mIsTouchRun      = false;
     if (!(cs.mCurMobalId == MobaObjectID.HeroJiansheng && skillIndex == 4 && pm.mCurSkillTime != 0))
     {
         mCurAddBuff.Clear();
     }
     //判断是否有跟随动作的buff
     if (GameLibrary.Instance().CheckExistSpecialBySkillNode(mCurSkillNode))
     {
         if (!(skillIndex == 4 && cs.mCurMobalId == MobaObjectID.HeroJiansheng && pm.mCurSkillTime != 0))
         {
             mCurAddBuff = mCurSkillNode.AddSpecialBuffs(cs);
         }
     }
     if (cs.mCurMobalId == MobaObjectID.HeroJiansheng)
     {
         if (skillIndex == 3)
         {
             SkillBuff mTempBuff = SkillBuffManager.GetInst().GetSkillBuffListByCs(cs).FindLast(a => a.id == (long)SkillBuffType.AddAttack && a.attacker == cs);
             mCurAddBuff.Add(mTempBuff);
         }
         else if (skillIndex == 1)
         {
             pm.canMoveSwitch--;
         }
     }
     else if (cs.mCurMobalId == MobaObjectID.HeroLuosa)
     {
         List <SkillBuff> mExistTalentBuff = SkillBuffManager.GetInst().GetSkillBuffListByCs(cs).FindAll(a => a.attacker == cs &&
                                                                                                         ((a.node.type == BuffType.talent && a.node.buffActionType == buffActionType.skill) || (SkillBuffType)a.id == SkillBuffType.AddSkillDamage));
         for (int i = 0; i < mExistTalentBuff.Count; i++)
         {
             mCurAddBuff.Add(mExistTalentBuff[i]);
         }
     }
     else if (cs.mCurMobalId == MobaObjectID.HeroHuanci)
     {
         if (skillIndex == 4)
         {
             pm.canMoveSwitch--;
         }
     }
     else if (cs.mCurMobalId == MobaObjectID.HeroXiongmao)
     {
         if (skillIndex == 1)
         {
             pm.canMoveSwitch--;
         }
     }
     else if (GameLibrary.Instance().CheckModelIsBoss006(cs))
     {
         if (pm.mIsHangIn && !(skillIndex == 2 || skillIndex == 3))
         {
             cs.transform.position = cs.mOriginPos;
         }
     }
 }