Пример #1
0
 // 预下载  wxl
 void PreDownload()
 {
     if (Core.Data.usrManager.UserConfig.cartoon == 1)
     {
         UIDownloadTexture preLoad = new UIDownloadTexture();
         StartCoroutine(preLoad.PreDownload((Core.Data.newDungeonsManager.lastFloorId + 2) + "-1.jpg"));
         StartCoroutine(preLoad.PreDownload((Core.Data.newDungeonsManager.lastFloorId + 2) + "-2.jpg"));
     }
 }
Пример #2
0
    void Start()
    {
        NDManager    = Core.Data.newDungeonsManager;
        list_chapter = NDManager.ChapterList;
        FloorList    = NDManager.FloorList;

        CreateMapObjectPool();

        uicenter = uiGrid.GetComponent <JCUICenterOnChild>();

        //地图点数(数量)
        int MapPointCount = LastFloorBelongMapID + 1;

        //计算开启关所在地图<章节>
        if (tempOpenFloorID > 0)
        {
            //临时跳转
            if (FloorList.TryGetValue(tempOpenFloorID, out CurOpenFloor))
            {
                ArrowAtMapID = (CurOpenFloor.BelongChapterID - NDManager.startChapterID) / 100;
            }
        }
        else
        {
            //正常跳转到最新关
            int CurOpenFloorID = NDManager.lastFloorId + 1;
            if (CurOpenFloorID > 60548)
            {
                CurOpenFloorID = 60548;
            }
            //如果关卡存在
            if (FloorList.TryGetValue(CurOpenFloorID, out CurOpenFloor))
            {
                //计算箭头所在地图
                ArrowAtMapID = (CurOpenFloor.BelongChapterID - NDManager.startChapterID) / 100;
                //如果箭头所在地图没有解锁
                while (!isUnlockMap(ArrowAtMapID, false) && CurOpenFloorID > NDManager.startFloorID)
                {
                    CurOpenFloorID--;
                    if (FloorList.TryGetValue(CurOpenFloorID, out CurOpenFloor))
                    {
                        ArrowAtMapID  = (CurOpenFloor.BelongChapterID - NDManager.startChapterID) / 100;
                        MapPointCount = ArrowAtMapID + 1;
                    }
                }
            }
        }

        CurMapIndex = ArrowAtMapID;

        //创建点
        points.Refresh(MapPointCount);
        points.SetBright(ArrowAtMapID);

        uicenter.onFinished  += MoveFinished;
        uicenter.onStartMove += MoveStarted;

        #region 初始化最近的三张地图
        for (int i = -1; i <= 1; i++)
        {
            NewChapter nchapter  = null;
            int        chapterID = 30100 + (ArrowAtMapID + i) * 100;
            list_chapter.TryGetValue(chapterID, out nchapter);
            List_Maps[i + 1].SetMap(nchapter);
            if (i == 0)
            {
                SetTitle(chapterID);
            }
        }
        if (CurMapIndex == 0 && !isUnlockMap(1, false))
        {
            _uiscrollview.enabled = false;
        }
        #endregion

        #region 设置箭头的坐标
        SetJianTouPos(CurOpenFloor);
        #endregion


        //检测最新漫画 是否 下载
        if (Core.Data.usrManager.UserConfig.cartoon == 1)
        {
            UIDownloadTexture ud = new UIDownloadTexture();
            StartCoroutine(ud.PreDownload((Core.Data.newDungeonsManager.lastFloorId + 2).ToString() + "-1.jpg"));
            StartCoroutine(ud.PreDownload((Core.Data.newDungeonsManager.lastFloorId + 2).ToString() + "-2.jpg"));
        }
    }