/// <summary>
        /// 销毁GameObject前要进行的操作
        /// </summary>
        public void DestroyAll()
        {
            mThunderHitInfo = null;
            m_HitCallback   = null;
            m_SkillInfo     = null;

            EffectManager.GetInstance().RemoveSkillInstance(mID);
            if (mEffectBaseComponent != null)
            {
                mEffectBaseComponent.DestroyAll();
            }
        }
 /// <summary>
 /// 设置闪电链伤害的信息
 /// </summary>
 /// <param name="info"></param>
 public void SetThunderHitInfo(ThunderHitInfo info)
 {
     mThunderHitInfo = info;
 }
Beispiel #3
0
        public static void HandleServerData(ushort protocol, byte[] data)
        {
            switch (protocol)
            {
            case NetMsg.MSG_NWAR_HIT:    // 受击
            {
                var nwar_hit = S2CPackBase.DeserializePack <S2CNwarHit>(data);

                var actor = ActorManager.Instance.GetPlayer(nwar_hit.hit.dst_id);
                if (actor != null)
                {
                    actor.BeattackedCtrl.HandleBeattacked(nwar_hit);
                }
            }
            break;

            case NetMsg.MSG_NWAR_THUNDER:    // 闪电链的伤害
            {
                var nwar_thunder = S2CPackBase.DeserializePack <S2CNwarThunder>(data);

                SkillAttackInstance attac_inst = EffectManager.GetInstance().GetAttackInstance(nwar_thunder.em_id);
                if (attac_inst != null)
                {
                    ThunderHitInfo hit_info = new ThunderHitInfo();
                    hit_info.ActorID         = nwar_thunder.act_id;
                    hit_info.EmitID          = nwar_thunder.em_id;    //伤害id
                    hit_info.SkillID         = nwar_thunder.skill_id; // 技能id
                    hit_info.HitPlayers      = nwar_thunder.uuids;    //依次打到的玩家列表
                    hit_info.SkillAttackInst = attac_inst;

                    if (hit_info.Init())
                    {
                        attac_inst.SetThunderHitInfo(hit_info);
                    }
                }
            }
            break;

            case NetMsg.MSG_NWAR_UNIT_DEAD:    //死亡
            {
                var death_msg = S2CPackBase.DeserializePack <S2CNwarUnitDead>(data);

                var actor = ActorManager.Instance.GetPlayer(death_msg.id);
                if (actor != null)
                {
                    actor.BeattackedCtrl.HandleKillActor(death_msg);
                }
            }
            break;

            case NetMsg.MSG_NWAR_BUFF_SUB_HP:    // buff减血
            {
                var   rep = S2CPackBase.DeserializePack <S2CNwarBuffSubHp>(data);
                Actor act = ActorManager.Instance.GetPlayer(rep.uuid);
                if (act != null && !act.IsDead())
                {
                    act.DoDamage(rep.act_id, (int)rep.hp, 0f, false, 0);
                }
            }
            break;

            case NetMsg.MSG_NWAR_BUFF_SUB_EN:    // buff减蓝
            {
            }
            break;

            case NetMsg.MSG_NWAR_BUFF_ADD_HP:    // buff加血
            {
                var   rep = S2CPackBase.DeserializePack <S2CNwarBuffAddHp>(data);
                Actor act = ActorManager.Instance.GetPlayer(rep.uuid);
                if (act != null && !act.IsDead() && act.IsLocalPlayer)
                {
                    act.ShowDamageEffect(FightEffectHelp.FightEffectType.AddHp, rep.act_id, (int)rep.hp);
                }
            }
            break;

            case NetMsg.MSG_NWAR_SKILL_SING:     //结束吟唱阶段
            {
                var   rep = S2CPackBase.DeserializePack <S2CNwarSkillSing>(data);
                Actor act = ActorManager.Instance.GetPlayer(rep.uuid);
                if (act != null && !act.IsDead() && act.IsLocalPlayer == false)
                {
                    Skill skill = act.GetCurSkill();
                    if (skill != null && skill.SkillID == rep.skill_id)
                    {
                        if (skill.CurAction != null)
                        {
                            skill.CurAction.FinishCastingReadyStage();
                        }
                    }
                }
            }
            break;

            case NetMsg.MSG_NWAR_BUFF_IMMUNE:     //免疫飘字
            {
                var   rep      = S2CPackBase.DeserializePack <S2CNwarBuffImmune>(data);
                Actor defender = ActorManager.Instance.GetActor(rep.uuid);
                if (defender != null)
                {
                    defender.ShowDamageEffect(FightEffectHelp.FightEffectType.Immune, rep.act_id, 0);
                }
            }
            break;

            case NetMsg.MSG_NWAR_BUFF_WORD:     //buff飘字效果
            {
                var    rep     = S2CPackBase.DeserializePack <S2CNwarBuffWord>(data);
                var    word_id = rep.word;
                string word    = DBFlyWord.GetFlyWordById(word_id);
                if (word != "")
                {
                    UINotice.Instance.ShowMessage(word);
                }
            }
            break;

            default:
                break;
            }
        }