示例#1
0
 public void SetMyCamp(GameCmd.eCamp camp)
 {
     if (m_CampCombatResultInfo != null)
     {
         m_CampCombatResultInfo.m_MyCampCombatInfo.camp = camp;
     }
 }
示例#2
0
    /// <summary>
    /// 全局UI事件处理器
    /// </summary>
    /// <param name="eventType"></param>
    /// <param name="data"></param>
    public void GlobalEventHandler(int eventType, object data)
    {
        switch (eventType)
        {
        case (int)Client.GameEventID.SYSTEM_LOADSCENECOMPELETE:
        {
            Client.stLoadSceneComplete loadScene = (Client.stLoadSceneComplete)data;
            if (loadScene.nMapID == 159)
            {
                DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CampFightingPanel);
            }
        }
        break;

        case (int)Client.GameEventID.ENTITYSYSTEM_LEVELUP:
        {
            CaculateCampSectionIndex();
        }
        break;

        case (int)Client.GameEventID.ENTITYSYSTEM_CREATEENTITY:
        {
            //             if (isEnterScene == false)
            //             {
            //                 return;
            //             }

            Client.stCreateEntity npcEntity = (Client.stCreateEntity)data;

            Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
            if (es == null)
            {
                return;
            }

            Client.IEntity npc = es.FindEntity(npcEntity.uid);
            if (npc == null)
            {
                return;
            }

            int npcBaseId = npc.GetProp((int)Client.EntityProp.BaseID);
            //采集物
            table.NpcDataBase npctable = GameTableManager.Instance.GetTableItem <table.NpcDataBase>((uint)npcBaseId);
            if (npctable != null && npctable.dwType == (uint)GameCmd.enumNpcType.NPC_TYPE_COLLECT_PLANT)        //采集物
            {
                GameCmd.eCamp camp = (GameCmd.eCamp)npc.GetProp((int)Client.CreatureProp.Camp);
                if (m_CampCombatResultInfo != null && m_CampCombatResultInfo.m_MyCampCombatInfo.camp != camp)
                {
                    CampNpcOnTrigger callback = new CampNpcOnTrigger();
                    npc.SetCallback(callback);
                }
            }
        }
        break;
        }
    }
示例#3
0
 public void Reset()
 {
     m_lstCampCombatPlayers.Clear();
     nType        = 0;
     nKillBossNum = 0;
     nReliveNum   = 0;
     nScore       = 0;
     nType        = GameCmd.eCamp.CF_None;
 }
示例#4
0
 public void Reset()
 {
     camp    = GameCmd.eCamp.CF_None;
     userid  = 0;
     nRank   = 0;
     strName = "";
     nScore  = 0;
     nKill   = 0;
     nDead   = 0;
     nAssist = 0;
 }
示例#5
0
 void SetCampNpOnTrigger(GameCmd.eCamp mycamp)
 {
     Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
     if (es != null)
     {
         es.FindAllEntity <Client.INPC>(ref m_lstNpc);
         for (int i = 0; i < m_lstNpc.Count; i++)
         {
             Client.INPC   npc  = m_lstNpc[i];
             GameCmd.eCamp camp = (GameCmd.eCamp)npc.GetProp((int)Client.CreatureProp.Camp);
             if (mycamp != camp)
             {
                 CampNpcOnTrigger callback = new CampNpcOnTrigger();
                 npc.SetCallback(callback);
                 UnityEngine.Debug.Log("SetCallback : " + npc.GetName());
             }
         }
         m_lstNpc.Clear();
     }
 }
示例#6
0
    /// <summary>
    /// 刷新阵营战信息
    /// </summary>
    /// <param name="ecamp"></param>
    /// <param name="lstInfo"></param>
    public void UpdateCampUsersInfo(GameCmd.eCamp ecamp, GameCmd.stCampInfo campInfo)
    {
        CampCombatResultInfo.CampCombatResult campResultInfo = null;
        if (ecamp == GameCmd.eCamp.CF_Green)
        {
            campResultInfo = m_CampCombatResultInfo.m_camp_Green;
        }
        else if (ecamp == GameCmd.eCamp.CF_Red)
        {
            campResultInfo = m_CampCombatResultInfo.m_camp_Red;
        }

        if (campResultInfo != null)
        {
            campResultInfo.nKillBossNum = campInfo.kill_boss;
            campResultInfo.nReliveNum   = campInfo.relive_num;
            campResultInfo.nScore       = campInfo.score;
            campResultInfo.nType        = ecamp;

            List <GameCmd.stCampMemberInfo> lstInfo = campInfo.member_info;
            campResultInfo.m_lstCampCombatPlayers.Clear();

            for (int k = 0; k < lstInfo.Count; k++)
            {
                CampCombatResultInfo.CampCombatPlayerInfo playerInfo = new CampCombatResultInfo.CampCombatPlayerInfo();
                GameCmd.stCampMemberInfo info = lstInfo[k];
                playerInfo.userid  = info.userid;
                playerInfo.nAssist = info.assist;
                playerInfo.nDead   = info.killed;
                playerInfo.nKill   = info.kill;
                playerInfo.nRank   = info.rank;
                playerInfo.strName = info.name;
                playerInfo.nScore  = (uint)info.score;
                playerInfo.camp    = info.camp;
                campResultInfo.m_lstCampCombatPlayers.Add(playerInfo);
            }

            SortCampMemberRank(ref campResultInfo.m_lstCampCombatPlayers);
        }
    }