Esempio n. 1
0
    void OnClickEndItem(GameObject games)
    {
        CheckPointRef refData = UIEventListener.Get(games).parameter as CheckPointRef;

        itemOpen.SetEndItem(refData);
        itemOpen.gameObject.SetActive(true);
    }
Esempio n. 2
0
 protected override void OnOpen()
 {
     base.OnOpen();
     if (labCapterName != null)
     {
         CheckPointRef pointRef = ConfigMng.Instance.GetCheckPointRef(GameCenter.mainPlayerMng.MainPlayerInfo.SceneID);
         if (pointRef != null)
         {
             labCapterName.text = pointRef.name;
         }
     }
 }
Esempio n. 3
0
    void CreateItem(ChapterRef dataList)
    {
        CheckPointRef       refData = null;
        int                 i = 0, len = 0;
        GameObject          go      = null;
        EndLessTrialsItemUI endLess = null;

        for (i = 0, len = dataList.allLevels.Count; i < len; i++)
        {
            refData = ConfigMng.Instance.GetCheckPointRef(dataList.allLevels[i]);
            if (refData == null)
            {
                continue;
            }
            if (listEndItem.Count <= i)
            {
                go = (GameObject)GameObject.Instantiate(itemEty);
                go.transform.parent        = lineEty.transform.parent;
                go.transform.localPosition = new Vector3(refData.coordinate.x, refData.coordinate.y, -1f);
                go.transform.localScale    = Vector3.one;
                go.name = "EndLessTrialsItem" + refData.id;
                endLess = go.GetComponent <EndLessTrialsItemUI>();
                endLess.SetEndItem(refData);
                UIEventListener.Get(go).onClick   = OnClickEndItem;
                UIEventListener.Get(go).parameter = refData;
                listEndItem.Add(endLess);
                go.SetActive(true);
            }
            else
            {
                listEndItem[i].gameObject.name = "EndLessTrialsItem" + refData.id;
                listEndItem[i].SetEndItem(refData);
                listEndItem[i].transform.localPosition = new Vector3(refData.coordinate.x, refData.coordinate.y, -1f);
                UIEventListener.Get(listEndItem[i].gameObject).onClick   = OnClickEndItem;
                UIEventListener.Get(listEndItem[i].gameObject).parameter = refData;
                listEndItem[i].gameObject.SetActive(true);
            }
        }
    }
Esempio n. 4
0
 public void SetEndItem(CheckPointRef _data)
 {
     data = _data;
     OnCurChapterItemUpdate();
 }
Esempio n. 5
0
    /// <summary>
    /// 收到系统信息
    /// </summary>
    public ChatInfo(pt_system_msg_d689 _pt)
    {
        ChatTemplatesRef Ref = ConfigMng.Instance.GetChatTemplatesRef(_pt.type);

        if (Ref != null)
        {
            isSystemInfo = true;
            chatTypeID   = 5;
            if (Ref.channel.Count > 0)
            {
                switch (Ref.channel[0])
                {
                case 1: chatTypeID = 5; break;

                case 3: chatTypeID = 3; break;

                default: chatTypeID = 5; break;
                }
            }
            else
            {
                Debug.LogError("ChatTemplatesRef 表中的channel字段数据异常  by黄洪兴");
            }
            string        st   = Ref.text;
            int           a    = 0;
            List <string> list = new List <string>();
            for (int i = 0; i < Ref.parameter.Count; i++)
            {
                switch (Ref.parameter[i])
                {
                case 1: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data); funcationList.Add(1);
                    }
                    break;

                case 2: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            EquipmentInfo item = new EquipmentInfo(Convert.ToInt32(_pt.nomal_list[i].data), EquipmentBelongTo.PREVIEW);
                            equipmentRefList.Add(item);
                            list.Add(item.ItemStrColor + item.ItemName + "[-]");
                            funcationList.Add(2);
                        }
                    }
                    break;

                case 3: if (_pt.item.Count > a)
                    {
                        EquipmentInfo item = new EquipmentInfo(_pt.item[a], true); equipmentList.Add(item); list.Add(item.ItemStrColor + item.ItemName + "[-]"); a++; funcationList.Add(3);
                    }
                    break;

                case 4: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            SceneRef SceneRef = ConfigMng.Instance.GetSceneRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (SceneRef != null)
                            {
                                list.Add(SceneRef.name);
                            }
                            funcationList.Add(4);
                        }
                    }
                    break;

                case 5: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MonsterRef monsterRef = ConfigMng.Instance.GetMonsterRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (monsterRef != null)
                            {
                                list.Add(monsterRef.name);
                            }
                        }
                    }
                    break;

                case 6: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 7: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 8: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 9: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 10: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MonsterRef monsterRef = ConfigMng.Instance.GetMonsterRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (monsterRef != null)
                            {
                                list.Add(monsterRef.name);
                            }
                        }
                    }
                    break;

                case 13: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 14: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            MountRef mountRef = ConfigMng.Instance.GetMountRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (mountRef != null)
                            {
                                list.Add(mountRef.mountName);
                            }
                        }
                    }
                    break;

                case 15: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            RidePropertyRef rideRef = ConfigMng.Instance.GetMountPropertyRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (rideRef != null)
                            {
                                list.Add(rideRef.name);
                            }
                        }
                    }
                    break;

                case 16: if (_pt.nomal_list.Count > i)
                    {
                        string s = string.Empty;
                        int    num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            switch (Convert.ToInt32(_pt.nomal_list[i].data))
                            {
                            case 1: s = ConfigMng.Instance.GetUItext(70); break;

                            case 2: s = ConfigMng.Instance.GetUItext(71); break;

                            case 3: s = ConfigMng.Instance.GetUItext(72); break;

                            case 4: s = ConfigMng.Instance.GetUItext(73); break;

                            case 5: s = ConfigMng.Instance.GetUItext(74); break;

                            default:
                                break;
                            }
                            if (s != string.Empty)
                            {
                                list.Add(s);
                            }
                        }
                    }
                    break;

                case 18: if (_pt.nomal_list.Count > i)
                    {
                        if (_pt.nomal_list[i].data != string.Empty)
                        {
                            list.Add(_pt.nomal_list[i].data);
                        }
                        else
                        {
                            list.Add(string.Empty);
                        }
                    }
                    break;

                case 19: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 20: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            list.Add(ConfigMng.Instance.GetLevelDes(Convert.ToInt32(_pt.nomal_list[i].data)));
                        }
                    }
                    break;

                case 23: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            playerID.Add(Convert.ToInt32(_pt.nomal_list[i].data));
                        }
                    }
                    break;

                case 24: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 25: if (_pt.nomal_list.Count > i)
                    {
                        int num;
                        if (int.TryParse(_pt.nomal_list[i].data, out num))
                        {
                            CheckPointRef CKRef = ConfigMng.Instance.GetCheckPointRef(Convert.ToInt32(_pt.nomal_list[i].data));
                            if (CKRef != null)
                            {
                                list.Add(CKRef.name);
                            }
                        }
                    }
                    break;

                case 26: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                case 27: if (_pt.nomal_list.Count > i)
                    {
                        list.Add(_pt.nomal_list[i].data);
                    }
                    break;

                default:
                    break;
                }
            }

            chatContent = UIUtil.Str2Str(st, list);

            if (Ref.channel.Count > 1)
            {
                MerryGoRoundDataInfo Info = new MerryGoRoundDataInfo(chatContent);
                if (GameCenter.chatMng.OnAddMerryGoRoundData != null)
                {
                    GameCenter.chatMng.OnAddMerryGoRoundData(Info);
                }
            }
        }
    }
Esempio n. 6
0
    /// <summary>
    /// 刷新自身数据
    /// </summary>
    void RefreshMyData()
    {
        myDataOne = GameCenter.newRankingMng.myValue1;
        myDataTwo = GameCenter.newRankingMng.myValue2;
        //是否上榜
        if (GameCenter.newRankingMng.myRank <= 100 && GameCenter.newRankingMng.myRank != 0 && myRank != null)
        {
            myRank.gameObject.SetActive(true);
            myNoRank.gameObject.SetActive(false);
            myRank.text = GameCenter.newRankingMng.myRank.ToString();
            if (nameLabel != null)
            {
                nameLabel.gameObject.SetActive(true);
            }
            if (nameLabel != null)
            {
                nameLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.Name;
            }
        }
        else
        {
            myRank.gameObject.SetActive(false);
            myNoRank.gameObject.SetActive(true);
            if (nameLabel != null)
            {
                nameLabel.gameObject.SetActive(false);
            }
        }
        if (myDataLabel != null)
        {
            guildLabel.gameObject.SetActive(false);
            myDataLabel.gameObject.SetActive(true);
            switch (rankType - 1)
            {
            case 0:
                myDataLabel.text = myDataOne.ToString();
                break;

            case 1:
                myDataLabel.text = ConfigMng.Instance.GetLevelDes(myDataOne);
                break;

            case 2:
                if (myDataOne != 0)
                {
                    myDataLabel.text = myDataOne.ToString();
                }
                else
                {
                    myDataLabel.gameObject.SetActive(false);
                }
                break;

            case 3:
                if (myDataOne != 0)
                {
                    RidePropertyRef rideRef = ConfigMng.Instance.GetMountPropertyRef(myDataOne);
                    myDataLabel.text = rideRef == null ? string.Empty : rideRef.name;
                }
                else
                {
                    myDataLabel.gameObject.SetActive(false);
                }
                break;

            case 4:
                if (myDataOne != 0)
                {
                    CheckPointRef chapRef = ConfigMng.Instance.GetCheckPointRef(myDataOne);
                    myDataLabel.text = chapRef == null ? string.Empty : chapRef.name;
                }
                else
                {
                    myDataLabel.gameObject.SetActive(false);
                }
                break;

            case 5:
                if (nameLabel != null)
                {
                    nameLabel.text = GameCenter.mainPlayerMng.MainPlayerInfo.GuildName;
                }
                if (myDataOne != 0 && myDataTwo != 0)
                {
                    myDataLabel.gameObject.SetActive(false);
                    guildLabel.gameObject.SetActive(true);
                    guildLabel.text = myDataOne + "      " + myDataTwo;
                }
                else
                {
                    guildLabel.gameObject.SetActive(false);
                    myDataLabel.gameObject.SetActive(false);
                }
                break;

            case 6:
                if (myDataOne != 0)
                {
                    WingRef wingRef = ConfigMng.Instance.GetWingRef(myDataOne, myDataTwo);
                    myDataLabel.text = wingRef == null ? string.Empty : wingRef.name;
                }
                else
                {
                    myDataLabel.gameObject.SetActive(false);
                }
                break;

            default:
                if (myDataOne != 0)
                {
                    myDataLabel.text = myDataOne.ToString();
                }
                else
                {
                    myDataLabel.gameObject.SetActive(false);
                }
                break;
            }
        }
    }