Exemplo n.º 1
0
    void OnDamageBtnClick(GameObject go)
    {
        if (null != damagePanel)
        {
            damagePanel.gameObject.SetActive(false);
        }
        Settlement.SetActive(true);
        HistoryRank.gameObject.SetActive(true);
        if (isWin)
        {
            winGo.SetActive(true);
            if (Globe.maxRk > Globe.mrk)
            {
                highest.enabled = true;
            }
            HistoryRank.text = Globe.maxRk + "名";
            receive.text     = Globe.diamond + "";
            mHero.transform.localPosition = new Vector3(48.6f, 162, 0);
        }
        else
        {
            loseGo.SetActive(true);
            mHero.transform.localPosition = new Vector3(48.6f, 90, 0);
        }
        mHero.RefreshUI(playerData.GetInstance().iconData.icon_name, playerData.GetInstance().selfData.level, playerData.GetInstance().selfData.playeName, Globe.mrk + "", isWin);
        if (isWin && null != Globe.arenahero)
        {
            RoleIconAttrNode icon = FSDataNodeTable <RoleIconAttrNode> .GetSingleton().FindDataByType(Globe.dPhoto);

            dHero.RefreshUI(null != icon ? icon.icon_name : "yx_00" + UnityEngine.Random.Range(1, 10), Globe.arenahero.lvl, Globe.arenahero.nm, "" + Globe.drk);
        }
        ConfirmBtn.gameObject.SetActive(true);
    }
Exemplo n.º 2
0
    protected override void Init()
    {
        _instance = this;
        base.Init();

        closeBtn.onClick         = OnCloseBtn;
        goodsMultList            = transform.FindComponent <GUISingleMultList>("GoodsMultList");
        view                     = transform.Find("GoodsListScrollView");
        goodsMultList.ScrollView = view;


        //roleIcon.spriteName = UIRoleInfo.Instance.roleIcon.spriteName;
        //roleIconBorder.spriteName = UIRoleInfo.Instance.roleIconBorder.spriteName;
        if (FSDataNodeTable <RoleIconAttrNode> .GetSingleton().DataNodeList.ContainsKey(playerData.GetInstance().iconFrameData.iconFrame_id))
        {
            foreach (int key in FSDataNodeTable <RoleIconAttrNode> .GetSingleton().DataNodeList.Keys)
            {
                if (key > 20000)
                {
                    RoleIconAttrNode a = FSDataNodeTable <RoleIconAttrNode> .GetSingleton().DataNodeList[key];

                    keyList.Add(a);
                }
            }
        }
    }
Exemplo n.º 3
0
 public override void Info(object obj)
 {
     if (null == obj)
     {
     }
     else
     {
         item = (RoleIconAttrNode)obj;
         Debug.Log(item.icon_name);
         icon.spriteName = item.icon_name;
     }
 }
Exemplo n.º 4
0
    protected override void Init()
    {
        _instance = this;
        base.Init();
        closeBtn.onClick         = OnCloseBtn;
        goodsMultList            = transform.FindComponent <GUISingleMultList>("GoodsMultList");
        view                     = transform.Find("GoodsListScrollView");
        goodsMultList.ScrollView = view;

        foreach (int key in FSDataNodeTable <RoleIconAttrNode> .GetSingleton().DataNodeList.Keys)
        {
            if (key < 10014 || key == 10030)
            {
                RoleIconAttrNode a = FSDataNodeTable <RoleIconAttrNode> .GetSingleton().DataNodeList[key];

                keyList.Add(a);
            }
        }
    }
Exemplo n.º 5
0
    private bool FriendsRecommendResult(CReadPacket packet)
    {
        Debug.Log(" FriendsRecommendResult  推荐好友");
        Dictionary <string, object> data = packet.data;

        int result = int.Parse(data["ret"].ToString());

        if (result == 0)
        {
            if (data.ContainsKey("item"))
            {
                playerData.GetInstance().friendListData.RecommendfriendList.Clear();
                if (null != data["item"] as object[])
                {
                    object[] goodList = data["item"] as object[];
                    for (int i = 0; i < goodList.Length; i++)
                    {
                        Dictionary <string, object> goodInfo = (Dictionary <string, object>)goodList[i];
                        FriendData info = new FriendData();
                        if (goodInfo.ContainsKey("nm"))
                        {
                            info.Name = goodInfo["nm"].ToString();
                        }
                        if (goodInfo.ContainsKey("id"))
                        {
                            info.PlayerId = long.Parse(goodInfo["id"].ToString());
                        }
                        if (goodInfo.ContainsKey("aid"))
                        {
                            info.AcountPlayerId = long.Parse(goodInfo["aid"].ToString());
                        }
                        if (goodInfo.ContainsKey("ptf"))
                        {
                            if (null != FSDataNodeTable <RoleIconAttrNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["ptf"].ToString())))
                            {
                                RoleIconAttrNode vo = FSDataNodeTable <RoleIconAttrNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["ptf"].ToString()));

                                info.PlayerFrame = vo.icon_name;
                            }
                        }
                        if (goodInfo.ContainsKey("lv"))
                        {
                            info.Level = int.Parse(goodInfo["lv"].ToString());
                        }
                        if (goodInfo.ContainsKey("hlv"))
                        {
                            info.HeroLevel = int.Parse(goodInfo["hlv"].ToString());
                        }
                        if (goodInfo.ContainsKey("pt"))
                        {
                            if (null != FSDataNodeTable <HeroNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["pt"].ToString())))
                            {
                                HeroNode vo = FSDataNodeTable <HeroNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["pt"].ToString()));

                                info.PlayerIcon = vo.icon_name + "_head";
                            }
                        }
                        if (goodInfo.ContainsKey("afc"))
                        {
                            info.Fighting = int.Parse(goodInfo["afc"].ToString());
                        }
                        if (goodInfo.ContainsKey("tl"))
                        {
                            if (0 != int.Parse(goodInfo["tl"].ToString()))
                            {
                                if (null != FSDataNodeTable <TitleNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["tl"].ToString())))
                                {
                                    TitleNode vo = FSDataNodeTable <TitleNode> .GetSingleton().FindDataByType(int.Parse(goodInfo["tl"].ToString()));

                                    info.Title = vo.titlename;
                                }
                            }
                            else
                            {
                                info.Title = "称号:无";
                            }
                        }
                        playerData.GetInstance().friendListData.RecommendfriendList.Add(info);
                    }
                    if (playerData.GetInstance().friendListData.RecommendfriendList.Count > 0)
                    {
                        List <FriendData> itemLt = new List <FriendData>();
                        playerData.GetInstance().friendListData.RecommendfriendList.Sort((a, b) => b.Fighting - a.Fighting);
                        FriendData temp = null;
                        for (int i = 0; i < playerData.GetInstance().friendListData.RecommendfriendList.Count; i++)
                        {
                            for (int j = i + 1; j < playerData.GetInstance().friendListData.RecommendfriendList.Count; j++)
                            {
                                if (playerData.GetInstance().friendListData.RecommendfriendList[j].Fighting == playerData.GetInstance().friendListData.RecommendfriendList[i].Fighting && playerData.GetInstance().friendListData.RecommendfriendList[j].Level > playerData.GetInstance().friendListData.RecommendfriendList[i].Level)
                                {
                                    temp = playerData.GetInstance().friendListData.RecommendfriendList[j];
                                    playerData.GetInstance().friendListData.RecommendfriendList[j] = playerData.GetInstance().friendListData.RecommendfriendList[i];
                                    playerData.GetInstance().friendListData.RecommendfriendList[i] = temp;
                                }
                            }
                        }
                    }
                }
            }
            return(true);
        }
        else
        {
            Control.ShowGUI(UIPanleID.UITooltips, EnumOpenUIType.DefaultUIOrSecond, false, data["desc"].ToString());
            return(false);
        }
    }