//----------------------------------------------------------------------------------------

        //根据副本点ID获取该副本的星星成绩
        public DaemonCopyVo GetDaemonCopyInfo(uint copyPointId)
        {
            DaemonCopyVo copyVo = new DaemonCopyVo();

            copyVo.grade     = -1;
            copyVo.usedTimes = 0;
            for (int i = 0; i < _daemonCopyInfo.Count; ++i)
            {
                if (_daemonCopyInfo[i].id == copyPointId)
                {
                    copyVo.grade     = _daemonCopyInfo[i].grade;
                    copyVo.usedTimes = _daemonCopyInfo[i].times;
                    break;
                }
            }

            return(copyVo);
        }
Beispiel #2
0
        //显示选中副本详细信息
        private void ShowCopyDetailView()
        {
            needVigour.text     = needVigourValue.ToString();           //显示选中副本需要消耗的体力点
            vigour.text         = MeVo.instance.vigour.ToString();
            vigour.color        = MeVo.instance.vigour < needVigourValue? Color.red: new Color(128.0f / 255, 224.0f / 255, 64.0f / 255, 1);
            smallMap.atlas      = copyIconAtlas;
            smallMap.spriteName = BaseDataMgr.instance.GetMapVo(copyPointId).resource_id.ToString();

            DaemonCopyVo copyVo = new DaemonCopyVo();

            copyVo = Singleton <DaemonIslandMode> .Instance.GetDaemonCopyInfo(copyPointId);

            remainCopyTimes = BaseDataMgr.instance.GetMapVo(copyPointId).enter_count - copyVo.usedTimes;
            UpdateMaxFightTimes();
            remainTimes.color = remainCopyTimes > 0? Color.white: Color.red;
            remainTimes.text  = copyVo.usedTimes + "/" + BaseDataMgr.instance.GetMapVo(copyPointId).enter_count;             //显示剩余次数
            //显示选中副本星星获取数量
            int starNum = copyVo.grade;

            for (int j = 1; j <= 3; ++j)
            {
                stars.FindChild("xx" + j).GetComponent <UISprite>().spriteName
                    = j <= starNum?"xingxing1":"kongxing";
            }


            string[] monsters = StringUtils.GetValueListFromString(
                BaseDataMgr.instance.GetSysDaemonIslandTree(copyPointId).monster_icon);
            ShowMonsters(monsterList, monsters, monstersGrid);

            string[] bosses = StringUtils.GetValueListFromString(
                BaseDataMgr.instance.GetSysDaemonIslandTree(copyPointId).boss_icon);
            ShowMonsters(bossList, bosses, bossGrid);

            ShowGoods(goodsList, goodsGrid);
            ShowFastFuncState();
        }
        //切换章节后调用刷新
        private void UpdateCopyInfoByCity()
        {
            worldName.text = BaseDataMgr.instance.GetSysDaemonIslandTree(selectWorldId).name;
            worldName.SetActive(true);
            UpDateCityChangeButtonState();

            //基本信息更新
            string[] copypointId;
            copypointId = StringUtils.GetValueListFromString(BaseDataMgr.instance.GetSysDaemonIslandTree(selectWorldId).list);
            SysMapVo copyPointInfo;

            for (int i = 0; i < copyPoints.Count; ++i)
            {
                copyPointInfo = BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i]));
                copyPoints[i].FindChild("Name").GetComponent <UILabel>().text        = copyPointInfo.name;
                copyPoints[i].FindChild("ditu").GetComponent <UISprite>().spriteName =
                    BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i])).resource_id.ToString();
            }

            //根据后端数据更新副本点信息
            DaemonCopyVo copyVo = new DaemonCopyVo();
            int          grade;
            int          usedTimes;
            uint         newMapId;

            getStarsNum = 0;
            for (int i = 0; i < copypointId.Length; ++i)
            {
                copyVo = Singleton <DaemonIslandMode> .Instance.GetDaemonCopyInfo(uint.Parse(copypointId[i]));

                grade     = copyVo.grade;
                usedTimes = copyVo.usedTimes;

                //更新可玩次数
                copyPoints[i].FindChild("Times").GetComponent <UILabel>().text = usedTimes + "/"
                                                                                 + BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i])).enter_count;
                copyPoints[i].FindChild("Times").GetComponent <UILabel>().color =
                    usedTimes < (BaseDataMgr.instance.GetMapVo(uint.Parse(copypointId[i])).enter_count)? Color.white: Color.red;

                getStarsNum += (grade > 0?grade:0);
                for (int j = 1; j <= 3; ++j)                  //更新副本星星获取数量
                {
                    copyPoints [i].FindChild("xx" + j).GetComponent <UISprite>().spriteName
                        = j <= grade?"xingxing1":"kongxing";
                }

                //更新副本开启状态
                newMapId = Singleton <DaemonIslandMode> .Instance.NewOpenMapId;
                if (grade >= 0 || uint.Parse(copypointId[i]) == newMapId)                  //开启该副本点
                {
                    copyPoints[i].GetComponent <BoxCollider>().enabled = true;
                    copyPoints[i].FindChild("suo").gameObject.SetActive(false);
                    copyPoints[i].FindChild("zhezao").gameObject.SetActive(false);
                    copyPoints[i].FindChild("new").gameObject.SetActive(false);
//					UIUtils.ChangeNormalShader( copyPoints[i].FindChild("ditu").GetComponent<UISprite>(), NORMAL_COPY_POINT_DEPTH);
                    copyPoints[i].FindChild("ditu").GetComponent <UISprite>().atlas = copyIconAtlas;
                    copyPoints[i].FindChild("ditu").GetComponent <UISprite>().depth = NORMAL_COPY_POINT_DEPTH;

                    if (grade < 0 && uint.Parse(copypointId[i]) == newMapId)
                    {
                        copyPoints[i].FindChild("new").gameObject.SetActive(true);
                    }
                }
                else
                {
                    copyPoints[i].GetComponent <BoxCollider>().enabled = false;
                    copyPoints[i].FindChild("new").gameObject.SetActive(false);
                    copyPoints[i].FindChild("suo").gameObject.SetActive(true);
                    copyPoints[i].FindChild("zhezao").gameObject.SetActive(true);
//					UIUtils.ChangeGrayShader( copyPoints[i].FindChild("ditu").GetComponent<UISprite>(), GRAY_COPY_POINT_DEPTH);
                    copyPoints[i].FindChild("ditu").GetComponent <UISprite>().atlas = copyIconGrayAtlas;
                    copyPoints[i].FindChild("ditu").GetComponent <UISprite>().depth = GRAY_COPY_POINT_DEPTH;
                }
                copyPoints[i].gameObject.SetActive(true);
            }

            UpdateBoxInfo();             // 更新宝箱状态
        }