예제 #1
0
 /// <summary>
 /// 技能id,攻击对象,回调
 /// </summary>
 public virtual void Init(SkillNode skillNode, GameObject targetTrans, Transform thisTrans, VoidResult action = null)
 {
     result        = action;
     mCurSkillNode = skillNode;
     if (targetTrans != null)
     {
         mHitTargetCs = targetTrans.GetComponent <CharacterState>();
         hit          = mHitTargetCs.mHitPoint;
     }
     if (thisTrans != null)
     {
         attackerTrans = thisTrans;
         attackerCs    = attackerTrans.GetComponent <CharacterState>();
         mResourceRoot = attackerCs.emission.GetEffectResourceRoot();
         if (attackerCs != null)
         {
             groupIndex = (int)attackerCs.groupIndex;
         }
         GameLibrary.Instance().SetSkillDamageCharaData(ref characterData, skillNode, attackerCs);
         if (attackerCs.mCurMobalId == MobaObjectID.HeroShenniu && mCurSkillNode.site == 4)
         {
             GameLibrary.Instance().SetSkillDamageCharaData(ref onceCharacterData, skillNode, attackerCs);
             onceCharacterData.skill_Damage [0] = skillNode.GetSkillBattleValueByRatio(0, attackerCs.CharData, 0.2f);
         }
     }
     //清除所有collider
     SetColliderEnable(transform);
     //属性设置完毕,开始显示播放
     if (mCurSkillNode != null)
     {
         gameObject.SetActive(true);
     }
     else
     {
         Debug.Log(attackerTrans);
     }
 }