Пример #1
0
    /// <summary>
    /// 坐骑红点提示
    /// </summary>
    public void SetRedRemind()
    {
        if (mountInfoList.Count <= 0)
        {
            GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.MOUNT, false);
            return;
        }
        bool            isCoinEnough         = false;
        bool            isItemEnough         = false;
        RidePropertyRef MountPropertyRefData = ConfigMng.Instance.GetMountPropertyRef(CurLev);

        if (MountPropertyRefData != null && MountPropertyRefData.item != null)
        {
            for (int j = 0; j < MountPropertyRefData.item.Count; j++)
            {
                if (MountPropertyRefData.item[j].eid == 5)
                {
                    if (GameCenter.mainPlayerMng.MainPlayerInfo != null)
                    {
                        if (GameCenter.mainPlayerMng.MainPlayerInfo.TotalCoinCount >= (ulong)MountPropertyRefData.item[j].count)
                        {
                            isCoinEnough = true;
                        }
                    }
                }
                else
                {
                    int itemId = MountPropertyRefData.item[j].eid;
                    if (GameCenter.inventoryMng.GetNumberByType(itemId) >= MountPropertyRefData.item[j].count)
                    {
                        isItemEnough = true;
                    }
                }
            }
        }
        if (isCoinEnough && isItemEnough)
        {
            if (CurLev < (ConfigMng.Instance.RidePropertyRefTable.Count - 1))
            {
                GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.MOUNT, true);
            }
            else
            {
                GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.MOUNT, false);
            }
        }
        else
        {
            GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.MOUNT, false);
        }
    }
Пример #2
0
    void ShowMountInfo()
    {
        if (propertyInfoVal != null)
        {
            for (int j = 0, max = curPropertyLab.Length; j < max; j++)
            {
                curPropertyLab[j].text = "0";
            }
        }
        for (int i = 0, max = starSp.Length; i < max; i++)
        {
            starSp[i].IsGray = UISpriteEx.ColorGray.Gray;
        }
        if (mountName != null)
        {
            mountName.text = (curTargetInfo.CurMountInfo != null) ? curTargetInfo.CurMountInfo.Name : ConfigMng.Instance.GetUItext(333);
        }
        if (curTargetInfo.CurMountInfo == null)
        {
            return;
        }
        if (mountTexture != null)
        {
            GameCenter.previewManager.TryPreviewMount(curTargetInfo.CurMountInfo, mountTexture);
        }
        RidePropertyRef mountPropertyRefData = ConfigMng.Instance.GetMountPropertyRef(curTargetInfo.CurMountInfo.Lev > 0 ? curTargetInfo.CurMountInfo.Lev : 1);

        if (propertyInfoVal != null)
        {
            if (mountPropertyRefData != null)
            {
                for (int j = 0, max = curPropertyLab.Length; j < max; j++)
                {
                    curPropertyLab[j].text = mountPropertyRefData.attr[j].ToString();
                }
            }
        }
        ShowStar(curTargetInfo.CurMountInfo.Lev % 9 == 0 ? 9 : curTargetInfo.CurMountInfo.Lev % 9 - 1);
    }
Пример #3
0
    /// <summary>
    /// 如果没有拥有该坐骑(没有解锁)不能化形显示灰色的骑上
    /// </summary>
    void ShowUnOwnMount()
    {
        if (illusionEx != null)
        {
            illusionEx.IsGray = UISpriteEx.ColorGray.Gray;
        }
        if (unlockLab != null)
        {
            unlockLab.gameObject.SetActive(true);
        }
        int id = 0;

        id = curData != null ? (curData.level - 9): 1;
        RidePropertyRef propertyRef = ConfigMng.Instance.GetMountPropertyRef(id);

        if (unlockLab != null && propertyRef != null)
        {
            unlockLab.text = ConfigMng.Instance.GetUItext(28, new string[1] {
                propertyRef.name
            });
        }
        if (disMountBtn != null)
        {
            disMountBtn.gameObject.SetActive(false);
        }
        if (mountInfoDic.Count <= 0)
        {
            activateMountBtn.gameObject.SetActive(true);
            rideBtn.gameObject.SetActive(false);
        }
        else
        {
            activateMountBtn.gameObject.SetActive(false);
            rideBtn.gameObject.SetActive(true);
            rideEx.IsGray = UISpriteEx.ColorGray.Gray;
        }
    }
Пример #4
0
    void ShowMountInfo()
    {
        if (mountName != null)
        {
            mountName.text = (curTargetInfo.CurMountInfo != null)?curTargetInfo.CurMountInfo.Name:ConfigMng.Instance.GetUItext(333);
        }
        if (curTargetInfo.CurMountInfo == null)
        {
            if (propertyInfoVal != null)
            {
                for (int j = 0, max = curPropertyLab.Length; j < max; j++)
                {
                    curPropertyLab[j].text = "0";
                }
            }
            ShowNoMount();
            return;
        }
        if (mountTexture != null)
        {
            GameCenter.previewManager.TryPreviewSingelMount(curTargetInfo.CurMountInfo, mountTexture);
        }
        RidePropertyRef mountPropertyRefData = ConfigMng.Instance.GetMountPropertyRef(curTargetInfo.CurMountInfo.Lev > 0 ? curTargetInfo.CurMountInfo.Lev : 1);

        if (propertyInfoVal != null)
        {
            if (mountPropertyRefData != null)
            {
                for (int j = 0, max = curPropertyLab.Length; j < max; j++)
                {
                    curPropertyLab[j].text = mountPropertyRefData.attr[j].ToString();
                }
            }
        }
        ShowStar((curTargetInfo.CurMountInfo.Lev - 1) % 9);
    }
Пример #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);
                }
            }
        }
    }
Пример #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;
            }
        }
    }
Пример #7
0
    public void SetAchievementItemData(AchievementRef _data, int _index)
    {
        if (getBtn != null)
        {
            UIEventListener.Get(getBtn.gameObject).onClick = delegate { GameCenter.achievementMng.C2S_ReqGetReward(_data.id); }
        }
        ;
        if (nameTitle != null)
        {
            nameTitle.text = _data.levelName;
        }
        if (chenHaoName != null && chenHao != null)
        {
            if (_data.titleName != "0")
            {
                chenHao.gameObject.SetActive(true);
                chenHaoName.gameObject.SetActive(true);
                chenHaoName.text = _data.titleName;
            }
            else
            {
                chenHao.gameObject.SetActive(false);
                chenHaoName.gameObject.SetActive(false);
            }
        }
        string[] str = null;
        //已拥有的成就数量
        achievementNum = 0;
        switch (_index)
        {
        case (int)AchievementType.COIN:    //铜钱
            if (GameCenter.achievementMng.currentAchievementNum >= _data.judgeNum1)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + GameCenter.achievementMng.currentAchievementNum + "[-]"
                };
            }
            break;

        case (int)AchievementType.LEV:    //道行
            if (_data.judgeNum2 == 0)
            {
                if (GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel >= _data.judgeNum1)
                {
                    isReach = true;
                    str     = new string[1] {
                        ConfigMng.Instance.GetLevelDes(_data.judgeNum1)
                    };
                }
                else
                {
                    isReach = false;
                    str     = new string[1] {
                        "[ff0000]" + ConfigMng.Instance.GetLevelDes(GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel) + "[-]"
                    };
                }
            }
            break;

        case (int)AchievementType.FIGHT:    //修为
            if (_data.judgeNum2 == 0)
            {
                if (GameCenter.mainPlayerMng.MainPlayerInfo.FightValue >= _data.judgeNum1)
                {
                    isReach = true;
                    str     = new string[1] {
                        _data.judgeNum1.ToString()
                    };
                }
                else
                {
                    isReach = false;
                    str     = new string[1] {
                        "[ff0000]" + GameCenter.mainPlayerMng.MainPlayerInfo.FightValue + "[-]"
                    };
                }
                if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
                {
                    isReach = true;
                    str     = new string[1] {
                        _data.judgeNum1.ToString()
                    };
                }
            }
            break;

        case (int)AchievementType.SKILLLEV:    //术法
            List <SkillInfo> list = GameCenter.skillMng.GetOwnSkill();
            for (int i = 0; i < list.Count; i++)
            {
                SkillInfo info = list[i];
                if (info.SkillLv >= _data.judgeNum1)
                {
                    achievementNum++;
                }
            }
            if (achievementNum >= _data.judgeNum2)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum2.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            break;

        case (int)AchievementType.STRENTHEQULEV:                                                //强化
            foreach (EquipmentInfo info in GameCenter.inventoryMng.GetPlayerEquipList().Values) //穿在身上的装备
            {
                if (info.UpgradeLv >= _data.judgeNum1)
                {
                    achievementNum++;
                }
            }
            if (achievementNum >= _data.judgeNum2)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum2.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum2.ToString()
                };
            }
            break;

        case (int)AchievementType.EQULEV:    //淬炼
            foreach (EquipmentInfo info in GameCenter.inventoryMng.GetPlayerEquipList().Values)
            {
                if (info.LV >= _data.judgeNum1)
                {
                    achievementNum++;
                }
            }
            if (achievementNum >= _data.judgeNum2)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum2.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum2.ToString()
                };
            }
            break;

        case (int)AchievementType.GEM:    //宝石
            achievementNum = GameCenter.inventoryMng.GetPlayerInlayGemNumByLv(_data.judgeNum1);
            if (achievementNum >= _data.judgeNum2)
            {
                isReach = true;
                str     = new string[1] {
                    achievementNum.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    achievementNum.ToString()
                };
            }
            break;

        case (int)AchievementType.SOPHISTICATION:    //洗练
            achievementNum = GameCenter.inventoryMng.GetWashAttrNumByQuality();
            if (achievementNum >= _data.judgeNum1)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            break;

        case (int)AchievementType.PETGRROW:    //宠物成长
            achievementNum = GameCenter.mercenaryMng.GetPetGrowUp(PetPropertyType.GROWUP, _data.judgeNum1);
            if (achievementNum >= 1)
            {
                isReach = true;
                str     = new string[1] {
                    "1"
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    "1"
                };
            }
            break;

        case (int)AchievementType.PETSPIRITUAL:    //宠物灵修
            if (dic.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    "1"
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]0[-]"
                };
            }
            //if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            //{
            //    isReach = true;
            //    str = new string[1] { "1" };
            //}
            break;

        case (int)AchievementType.APTITUDE:    //宠物资质
            achievementNum = GameCenter.mercenaryMng.GetPetGrowUp(PetPropertyType.APTITUDE, _data.judgeNum1);
            if (achievementNum >= 1)
            {
                isReach = true;
                str     = new string[1] {
                    "1"
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + achievementNum + "[-]"
                };
            }
            if (dic.ContainsKey(_data.id) || GameCenter.achievementMng.achievementTogRed.ContainsKey(_data.id))
            {
                isReach = true;
                str     = new string[1] {
                    "1"
                };
            }
            break;

        case (int)AchievementType.MOUNT:    //坐骑
            achievementNum = GameCenter.newMountMng.CurLev > 0 ? GameCenter.newMountMng.CurLev : 0;
            RidePropertyRef mountRef = ConfigMng.Instance.GetMountPropertyRef(achievementNum);
            if (achievementNum >= _data.judgeNum1)
            {
                isReach = true;
                RidePropertyRef mountAcRef = ConfigMng.Instance.GetMountPropertyRef(_data.judgeNum1);
                if (mountAcRef != null)
                {
                    str = new string[1] {
                        mountAcRef.name
                    }
                }
                ;
            }
            else
            {
                isReach = false;
                if (mountRef != null)
                {
                    str = new string[1] {
                        "[ff0000]" + mountRef.name + "[-]"
                    }
                }
                ;
                else
                {
                    str = new string[1] {
                        "[ff0000]" + achievementNum + "[-]" + "阶" + "[ff0000]" + achievementNum + "[-]" + "星"
                    }
                };
            }
            break;

        case (int)AchievementType.COPY:    //副本
            if (GameCenter.achievementMng.currentAchievementNum >= _data.judgeNum1)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + GameCenter.achievementMng.currentAchievementNum + "[-]"
                };
            }
            break;

        case (int)AchievementType.LABOUR:    //仙盟
            if (GameCenter.achievementMng.currentAchievementNum >= _data.judgeNum1)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + GameCenter.achievementMng.currentAchievementNum + "[-]"
                };
            }
            break;

        case (int)AchievementType.FASHION:    //时装
            if (GameCenter.achievementMng.currentAchievementNum >= _data.judgeNum1)
            {
                isReach = true;
                str     = new string[1] {
                    _data.judgeNum1.ToString()
                };
            }
            else
            {
                isReach = false;
                str     = new string[1] {
                    "[ff0000]" + GameCenter.achievementMng.currentAchievementNum + "[-]"
                };
            }
            break;

        default:
            isReach = false;
            break;
        }
        if (dic.ContainsKey(_data.id))
        {
            if ((dic[_data.id] as AchievementData).RewardState)
            {
                isGetReward = true;
            }
            else
            {
                isGetReward = false;
            }
        }
        else
        {
            isGetReward = false;
        }

        if (achievementLabel != null)
        {
            achievementLabel.text = UIUtil.Str2Str(_data.des, str);
        }
        if (isReach && !isGetReward)//达到领取状态
        {
            if (notComplete != null)
            {
                notComplete.gameObject.SetActive(false);
            }
            if (getBtn != null)
            {
                getBtn.gameObject.SetActive(true);
            }
            if (complete != null)
            {
                complete.gameObject.SetActive(false);
            }
            if (completeSp != null)
            {
                completeSp.gameObject.SetActive(true);
            }
        }
        else if (!isReach && !isGetReward)
        {
            if (notComplete != null)
            {
                notComplete.gameObject.SetActive(true);
            }
            if (getBtn != null)
            {
                getBtn.gameObject.SetActive(false);
            }
            if (complete != null)
            {
                complete.gameObject.SetActive(false);
            }
            if (completeSp != null)
            {
                completeSp.gameObject.SetActive(false);
            }
        }
        if (isGetReward)//已领奖
        {
            if (notComplete != null)
            {
                notComplete.gameObject.SetActive(false);
            }
            if (getBtn != null)
            {
                getBtn.gameObject.SetActive(false);
            }
            if (complete != null)
            {
                complete.gameObject.SetActive(true);
            }
            if (completeSp != null)
            {
                completeSp.gameObject.SetActive(true);
            }
        }
    }

    #endregion
}
Пример #8
0
    /// <summary>
    /// 根据等级刷新
    /// </summary>
    void RefreshMountInfo()
    {
        if (effect != null)
        {
            effect.SetActive(false);
        }
        if (chanceLab != null)
        {
            chanceLab.gameObject.SetActive(false);
        }
        if (trainLab != null)
        {
            trainLab.text = "坐骑培养";
        }
        if (GameCenter.newMountMng.CurLev % 9 == 0)
        {
            if (trainLab != null)
            {
                trainLab.text = "坐骑升阶";
            }
            if (chanceLab != null && MountPropertyRefData != null)
            {
                chanceLab.gameObject.SetActive(true);
                chanceLab.text = ((float)MountPropertyRefData.chance / 10000) * 100 + "%";
            }
            if (GameCenter.newMountMng.CurLev >= (ConfigMng.Instance.RidePropertyRefTable.Count - 1))//满级
            {
                if (trainEx != null)
                {
                    trainEx.IsGray = UISpriteEx.ColorGray.Gray;
                }
            }
        }

        for (int i = 0, max = starSp.Count; i < max; i++)
        {
            starSp[i].IsGray = UISpriteEx.ColorGray.Gray;
        }
        ShowStar();
        if (trainEx != null)
        {
            trainEx.IsGray = UISpriteEx.ColorGray.normal;
        }
        if (GameCenter.newMountMng.CurLev >= (ConfigMng.Instance.RidePropertyRefTable.Count - 1))//满级
        {
            if (trainMountBtn != null)
            {
                trainMountBtn.gameObject.SetActive(false);
            }
            if (levest != null)
            {
                levest.gameObject.SetActive(true);
            }
        }
        if (levLab != null && MountPropertyRefData != null)
        {
            levLab.text = MountPropertyRefData.name;
        }
        //当前等级属性
        if (MountPropertyRefData != null && curInfo != null)
        {
            for (int j = 0; j < curPropertyLab.Count; j++)
            {
                curPropertyLab[j].text = MountPropertyRefData.attr[j].ToString();
            }
        }
        //下级等级属性
        int tableLenth = ConfigMng.Instance.RidePropertyRefTable.Count - 1;

        if (nextLevAddLab.Count > 0 && curInfo != null)
        {
            int next = GameCenter.newMountMng.CurLev + 1;
            if (next >= tableLenth)
            {
                next = tableLenth;//超出表中的数据默认下级为最后一个
            }
            RidePropertyRef nextInfo = ConfigMng.Instance.GetMountPropertyRef(next);
            if (nextInfo != null && MountPropertyRefData != null)
            {
                for (int j = 0; j < nextLevAddLab.Count; j++)
                {
                    nextLevAddLab[j].text = (nextInfo.attr[j] - MountPropertyRefData.attr[j]).ToString();
                }
            }
        }
        //升级需要的财物
        bool isCoinEnough = false;
        bool isItemEnough = false;
        int  itemCount    = 0;

        if (MountPropertyRefData != null && MountPropertyRefData.item != null)
        {
            for (int j = 0; j < MountPropertyRefData.item.Count; j++)
            {
                if (MountPropertyRefData.item[j].eid == 5)
                {
                    if (MainPlayerInfo.TotalCoinCount < (ulong)MountPropertyRefData.item[j].count)
                    {
                        coinLab.text = MountPropertyRefData.item[j].count + "/" + "[ff0000]" + MainPlayerInfo.TotalCoinCount;
                    }
                    else
                    {
                        isCoinEnough = true;
                        coinLab.text = MountPropertyRefData.item[j].count + "/" + "[6ef574]" + MainPlayerInfo.TotalCoinCount;//需要的金币/拥有的
                    }
                }
                else
                {
                    itemId    = MountPropertyRefData.item[j].eid;
                    itemRef   = ConfigMng.Instance.GetEquipmentRef(itemId);
                    itemCount = MountPropertyRefData.item[j].count;
                    if (GameCenter.inventoryMng.GetNumberByType(itemId) >= itemCount)
                    {
                        isItemEnough = true;
                    }
                    if (GameCenter.inventoryMng.GetNumberByType(itemId) >= itemCount)
                    {
                        isItemEnough = true;
                        if (itemLab != null)
                        {
                            itemLab.text = itemCount + "/" + "[6ef574]" + GameCenter.inventoryMng.GetNumberByType(itemId);
                        }
                    }
                    else
                    {
                        if (itemLab != null)
                        {
                            itemLab.text = itemCount + "/" + "[ff0000]" + GameCenter.inventoryMng.GetNumberByType(itemId);
                        }
                    }
                }
            }
        }
        if (!isItemEnough)
        {
            if (itemRef != null && diamondLab != null && MainPlayerInfo != null)
            {
                diamondLab.text = (itemRef.diamonPrice) * itemCount + "/" + MainPlayerInfo.TotalDiamondCount.ToString();
            }
        }
        else
        {
            if (diamondLab != null && MainPlayerInfo != null)
            {
                diamondLab.text = "0/" + MainPlayerInfo.TotalDiamondCount.ToString();
            }
        }
        if (isItemEnough && isCoinEnough && !levest.gameObject.activeSelf)
        {
            trainRedMind.gameObject.SetActive(true);
        }
        else
        {
            trainRedMind.gameObject.SetActive(false);
        }
        //if (curData != null)
        //{
        //    bool isLoadAgin = false;
        //    MountInfo info = mountDic[curData.mountId] as MountInfo;
        //    if (info.MountEffectList.Count > 0)
        //    {
        //        for (int i = 0, max = info.MountEffectList.Count; i < max; i++)
        //        {
        //            MountEffect effect = info.MountEffectList[i];
        //            if ((info.ConfigID - 1) * 9 + effect.effectLev == GameCenter.newMountMng.CurLev)
        //            {
        //                if (mountDic.ContainsKey(curData.mountId))
        //                {
        //                    isLoadAgin = true;
        //                    break;
        //                }
        //            }
        //        }
        //    }
        //    if (isLoadAgin)//重新加载模型及特效
        //    {
        //        GameCenter.previewManager.SetPreviewMountEnpty();
        //        GameCenter.previewManager.TryPreviewSingelMount(info, mountLookTex);
        //    }
        //}
        //if (GameCenter.newMountMng.CurLev == 0)//激活坐骑
        //{
        //    RefreshList();
        //}
        //if ((index != (GameCenter.newMountMng.CurLev - 1) / 9) && isRereshListInvoke)
        //{
        //    CancelInvoke("refresh");//延迟刷新显示当前骑着的
        //    Invoke("refresh", 0.1f);
        //}
        //isRereshListInvoke = true;
    }
Пример #9
0
    /// <summary>
    /// 坐骑培养
    /// </summary>
    void OnClickTrainMountBtn(GameObject go)
    {
        if (trainEx.IsGray == UISpriteEx.ColorGray.Gray)
        {
            return;
        }
        if (curInfo == null)
        {
            return;
        }
        ulong           coinNum         = 0;
        int             itemNum         = 0;
        RidePropertyRef ridePropertyRef = ConfigMng.Instance.GetMountPropertyRef(GameCenter.newMountMng.CurLev);

        if (ridePropertyRef != null && ridePropertyRef.item != null)
        {
            for (int i = 0; i < ridePropertyRef.item.Count; i++)
            {
                if (ridePropertyRef.item[i].eid == 5)
                {
                    coinNum = (ulong)ridePropertyRef.item[i].count;
                }
                else
                {
                    itemNum = curInfo.Item[i].count;
                }
            }
        }
        if (MainPlayerInfo != null && MainPlayerInfo.TotalCoinCount >= coinNum)
        {
            if (GameCenter.inventoryMng.GetNumberByType(itemId) >= itemNum && atuoBuy != null)
            {
                GameCenter.newMountMng.C2S_ReqPromoteMount((atuoBuy.value == true) ? 1 : 0);
            }
            else//物品不足
            {
                if (atuoBuy != null && atuoBuy.value && itemRef != null)
                {
                    if (MainPlayerInfo != null && MainPlayerInfo.TotalDiamondCount >= itemRef.diamonPrice)
                    {
                        GameCenter.newMountMng.C2S_ReqPromoteMount(1);
                    }
                    else
                    {
                        MessageST mst1 = new MessageST();
                        mst1.messID = 137;
                        mst1.delYes = delegate
                        {
                            GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE);
                        };
                        GameCenter.messageMng.AddClientMsg(mst1);
                    }
                }
                else
                {
                    MessageST mst = new MessageST();
                    mst.messID = 158;
                    if (itemRef != null)
                    {
                        mst.words = new string[2] {
                            (itemRef.diamonPrice * itemNum).ToString(), itemRef.name
                        }
                    }
                    ;
                    mst.delYes = delegate
                    {
                        if (MainPlayerInfo != null && itemRef != null && MainPlayerInfo.TotalDiamondCount >= itemRef.diamonPrice)
                        {
                            GameCenter.newMountMng.C2S_ReqPromoteMount(1);
                        }
                        else
                        {
                            MessageST mst1 = new MessageST();
                            mst1.messID = 137;
                            mst1.delYes = delegate
                            {
                                GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE);
                            };
                            GameCenter.messageMng.AddClientMsg(mst1);
                        }
                    };
                    GameCenter.messageMng.AddClientMsg(mst);
                }
            }
        }
        else//金幣不足
        {
            GameCenter.messageMng.AddClientMsg(155);
        }
    }