示例#1
0
        public void CastSk(params Object[] args)
        {
            if (castor != null && param != null)
            {
                WarSrcAnimParam srcParam = param as WarSrcAnimParam;
                if (srcParam != null)
                {
                    SelfDescribed sd = srcParam.described;
                    if (sd != null)
                    {
                        EndResult result = sd.srcEnd;
//                        float x = result.param8;
//                        float z = result.param9;
                        Vector3 pos = Vector3.zero;
//                        castor.transform.position = pos;
//                        castor.SendNpcMoveMsg(true);
                        if (castor is ServerLifeNpc)
                        {
                            ServerLifeNpc sCastor = castor as ServerLifeNpc;
                            sCastor.HitAnimReset();
                        }
                        int clearFlag = result.param1;
                        if (clearFlag == 0)
                        {
                            ServerNPC npc = castor.getOneChildNpc(result.param2);
                            if (npc != null)
                            {
                                pos   = npc.transform.position;
                                pos.y = 0.1f;
                                castor.transform.position = pos;
                                castor.SendNpcMoveMsg(true);
                                castor.removeChild(npc);
                                WarServerManager mgr = WarServerManager.Instance;
                                IpcDestroyNpcMsg msg = new IpcDestroyNpcMsg();
                                msg.id = npc.UniqueID;
                                mgr.realServer.proxyCli.NpcDestroy(msg);
                                UnityEngine.GameObject.Destroy(npc.gameObject);
                            }
                        }
                    }
                }
            }
        }
示例#2
0
 public virtual void On_Killed(WarMsgParam param)
 {
     if (STATE != NpcAnimState.Killed)
     {
         STATE            = NpcAnimState.Killed;
         animationTimer   = 0f;
         SetHandler       = KilledHandle;
         animMsg.nextAnim = WarMsg_Type.BeKilled.ToString();
         animMsg.uniqueId = cachedNpc.UniqueID;
         if (serMgr != null)
         {
             serMgr.realServer.proxyCli.NPCAnim(animMsg);
         }
         isAttack    = false;
         isCastSkill = false;
         cachedNpc.HitAnimReset();
         cachedNpc.curStatus = cachedNpc.curStatus.clear(NpcStatus.InSkill);
     }
 }