示例#1
0
        public eOtherPlayerInfoType ParseInfoType(Hashtable checkData)
        {
            eOtherPlayerInfoType infoType = eOtherPlayerInfoType.only;

            if (checkData["infoType"] != null)
            {
                infoType = (eOtherPlayerInfoType)Enum.Parse(typeof(eOtherPlayerInfoType), checkData["infoType"].ToString());
            }
            return(infoType);
        }
示例#2
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);

            Hashtable            checkData = param as Hashtable;
            eOtherPlayerInfoType infoType  = ParseInfoType(checkData);

            //在ilr模式下无法转成枚举
            // eOtherPlayerInfoType infoType = Hotfix_LT.EBCore.Dot.Enum<eOtherPlayerInfoType>("infoType", checkData, 0);
            m_Uid = EB.Dot.Long(SmallPartnerPacketRule.REQUEST_OTHER_PLAYER_DATA_PARAM0, checkData, 0);

            int[] heightInfo = BGHeightDic[infoType];
            BG.height = heightInfo[0];

            InfoTran.localPosition = new Vector2(InfoTran.localPosition.x, heightInfo[1]);
            InfoTran.gameObject.CustomSetActive(infoType != eOtherPlayerInfoType.secret);
            PartnerTran.localPosition = new Vector2(InfoTran.localPosition.x, heightInfo[2]);

            if (infoType == eOtherPlayerInfoType.canInteraction)
            {
                if (FriendManager.Instance.MyFriends.Find(m_Uid) != null)
                {
                    m_AddFriendBtn.gameObject.CustomSetActive(false);
                    m_DelectFriendBtn.gameObject.CustomSetActive(true);
                }
                else
                {
                    m_AddFriendBtn.gameObject.CustomSetActive(true);
                    m_DelectFriendBtn.gameObject.CustomSetActive(false);
                }
            }

            Hashtable mainData = EB.Dot.Object("mainData", checkData, null);

            ShowMainInfo(mainData);

            string    type            = EB.Dot.String(SmallPartnerPacketRule.REQUEST_OTHER_PLAYER_DATA_PARAM1, checkData, null);
            string    dataType        = EB.Dot.String(SmallPartnerPacketRule.REQUEST_OTHER_PLAYER_DATA_PARAM2, checkData, null);
            Hashtable data            = EB.Dot.Object(SmallPartnerPacketRule.REQUEST_OTHER_PLAYER_DATA_PARAM3, checkData, null);
            var       listener        = this;
            string    otherPlayerName = EB.Dot.String("name", mainData, "");

            PartnerRoot.gameObject.CustomSetActive(false);
            CombatPowerLabel.gameObject.CustomSetActive(false);
            ShowOtherPlayerData(m_Uid, type, dataType, data, listener, otherPlayerName);
            BtnsObject.CustomSetActive(infoType == eOtherPlayerInfoType.canInteraction);
        }