示例#1
0
 private void Awake()
 {
     ChapterData        = TableDataExtension.GetTableData <DRChapter>(Data.GetInstance().getcurrentChapterID());
     LevelData          = TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getcurrentLevelID());
     ChapterNum         = TableDataExtension.GetTableData <DRScene>(Data.GetInstance().getcurrentSceneID()).ChapterNum;
     currentLevelallNum = ChapterData.BattleNum;
 }
示例#2
0
        //我失败了
        private void testLoser()
        {
            passLevelUIshow();
            int Chapter = Data.GetInstance().getcurrentChapterID();

            Data.GetInstance().setcurrentLevelID(int.Parse(Chapter + "01"));
            LevelData       = TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getcurrentLevelID());
            Level_Text.text = Data.GetInstance().getcurrentLevelID() + "";
            Debug.Log("失败");
        }
示例#3
0
        public void ClickEvent()
        {
            DRSkillDrop SkillData = TableDataExtension.GetTableData <DRSkillDrop>(luckNum);

            if (isClick)
            {
                describe.text = SkillData.Description;
            }
            else
            {
                describe.text = "";
            }
        }
示例#4
0
        // 下发这个章节对应数据信息


        private void ClickLeftButton()
        {
            if (SceneData.SceneOrder == 1)
            {
                //Debug.Log("场景开始");
                return;
            }
            Data.GetInstance().pluscurrentSceneID(-1);
            SceneData = TableDataExtension.GetTableData <DRScene>(Data.GetInstance().getcurrentSceneID());

            UIInfoShowBySceneID();
            //测试
            //Data.GetInstance().plusCoin(50.1f);
        }
示例#5
0
        private void OnScrollMove(Vector2 pVec)
        {
            //向下滚动
            while (mContentRect.anchoredPosition.y > (firstIndex + 1) * itemHeight && lastIndex != datasNum - 1)
            {
                //思路是List中的保存的GameObject顺序与真实显示的物体保持一致
                GameObject    _first     = itemList[0];
                RectTransform _rectTrans = _first.GetComponent <RectTransform>();
                //将首个物体移出List,再添加到List最后端
                itemList.RemoveAt(0);
                itemList.Add(_first);
                //将这个物体移到最下方
                _rectTrans.anchoredPosition = new Vector2(0, -(lastIndex + 1) * itemHeight);
                firstIndex += 1;
                lastIndex  += 1;
                //修改显示
                //_first.name = (lastIndex + 1).ToString();
                //_first.transform.Find("Text").GetComponent<Text>().text = _first.name;
                Debug.Log("idex" + lastIndex);
                if (lastIndex == datasNum - 1)
                {
                    skillID = luckNum; //偷天换柱
                    isClick = true;    //结束可点击
                }
                else
                {
                    skillID = itemID[lastIndex];
                }
                DRSkillDrop SkillData = TableDataExtension.GetTableData <DRSkillDrop>(skillID);
                _first.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/UIphoto/SkillChoiceMenuUI/skill_icon/" + SkillData.Preferb);
                //luckNum
                _first.name = SkillData.Skill;
                skillID++;

                //Debug.Log("下标" + lastIndex);
            }
            //向上滚动
            while (mContentRect.anchoredPosition.y < firstIndex * itemHeight && firstIndex != 0)
            {
                GameObject    _last      = itemList[itemList.Count - 1];
                RectTransform _rectTrans = _last.GetComponent <RectTransform>();
                itemList.RemoveAt(itemList.Count - 1);
                itemList.Insert(0, _last);
                _rectTrans.anchoredPosition = new Vector2(0, -(firstIndex - 1) * itemHeight);
                firstIndex -= 1;
                lastIndex  -= 1;
                _last.name  = firstIndex.ToString();
                //_last.transform.Find("Text").GetComponent<Text>().text = _last.name;
            }
        }
示例#6
0
 /// <summary>
 /// 展示 关卡 相关信息
 /// </summary>
 private void UIInfoShowByCurrentLevelID()
 {
     if (LevelData.BattleOrder == currentLevelallNum)
     {
         Debug.Log("当前章节已完成---结算界面,玩家选择下个章节");
         Level_Text.text = "模拟通关";
         test_image.SetActive(true);
         return;
     }
     Data.GetInstance().pluscurrentLevelID(1);
     refreshMaxLevel();
     LevelData       = TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getcurrentLevelID());
     Level_Text.text = Data.GetInstance().getcurrentLevelID() + "";
 }
示例#7
0
        private void ClickRightButton()
        {
            if (SceneData.SceneOrder == SceneNum || Data.GetInstance().getcurrentSceneID() + 1 > Data.GetInstance().getmaxSceneID())
            {
                //Debug.Log("可用场景结束");
                return;
            }

            Data.GetInstance().pluscurrentSceneID(1);
            SceneData = TableDataExtension.GetTableData <DRScene>(Data.GetInstance().getcurrentSceneID());

            UIInfoShowBySceneID();
            //测试
            //Data.GetInstance().plusCoin(-60.1f);
        }
示例#8
0
 private void UIInfoShowBySceneID()
 {
     SceneData = TableDataExtension.GetTableData <DRScene>(Data.GetInstance().getcurrentSceneID());
     if (SceneData.SceneOrder <= 2)
     {
         scene_image.sprite   = Resources.Load <Sprite>("UI/UIphoto/homeMenuUI/scene_" + SceneData.SceneOrder);
         sceneBG_image.sprite = Resources.Load <Sprite>("UI/UIphoto/homeMenuUI/sceneBG_" + SceneData.SceneOrder);
     }
     else
     {
         scene_image.sprite   = Resources.Load("UI/UIphoto/Number_" + SceneData.SceneOrder, typeof(Sprite)) as Sprite;
         sceneBG_image.sprite = Resources.Load <Sprite>("UI/UIphoto/homeMenuUI/sceneBG_" + 1);
     }
     mapName_image.sprite = Resources.Load("UI/UIphoto/" + SceneData.NameAsset, typeof(Sprite)) as Sprite;
     //测试
     //Debug.Log("当前场景 ID" + Data.GetInstance().getcurrentSceneID());
     id_text.text = Data.GetInstance().getcurrentSceneID() + "";
 }
示例#9
0
        // 通关点击事件--->开启新章程/开启新场景
        private void testPass()
        {
            if (ChapterData.ChapterOrder == ChapterNum)
            {
                //本场景所有章节全部完成 开启下个场景***预留
                Data.GetInstance().pluscurrentSceneID(1);
                Data.GetInstance().datachangeByScene();
                refreshMaxLevel();

                //Debug.Log("章节结束");
                test_image.SetActive(false);
                goback();
                return;
            }
            Data.GetInstance().pluscurrentChapterID(1);
            UIInfoShowByChapterID();
            LevelData = TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getcurrentLevelID());
            refreshMaxLevel();
            passLevelUIshow();
            test_image.SetActive(false);
        }
示例#10
0
        //章节ID 展示:通关奖励&章节选择
        private void UIInfoShowByChapterID()
        {
            ChapterData        = TableDataExtension.GetTableData <DRChapter>(Data.GetInstance().getcurrentChapterID());
            currentLevelallNum = ChapterData.BattleNum;
            Data.GetInstance().datachangeByChapter();
            LevelData = TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getcurrentLevelID());
            isshowLRLevle();
            Level_Text.text = Data.GetInstance().getcurrentLevelID() + "";
            passLevelUIshow();
            //Debug.Log(LevelData.BattleOrder);
            if (ChapterData == null)
            {
                //Debug.Log("小老弟你怎么了");
                return;
            }
            EnegyBonusNum_text.text = ChapterData.EnegyBonusNum + "";
            CoinBonusNum_text.text  = ChapterData.CoinBonusNum + "";
            GoldBonusNum_text.text  = ChapterData.GoldBonusNum + "";

            S_text.text = ChapterData.ChapterOrder + "";
            ChoiceShowing.GetComponent <Image>().sprite = Resources.Load("UI/UIphoto/choiceMenuUI/chaptericon_" + (ChapterData.ChapterOrder), typeof(Sprite)) as Sprite;
            if (ChapterData.ChapterOrder == 1)
            {
                L_text.text = "";
            }
            else
            {
                L_text.text = ChapterData.ChapterOrder - 1 + "";
                ChoiceLeft.GetComponent <Image>().sprite = Resources.Load("UI/UIphoto/choiceMenuUI/chaptericon_" + (ChapterData.ChapterOrder - 1), typeof(Sprite)) as Sprite;
            }
            if (ChapterData.ChapterOrder == ChapterNum)
            {
                R_text.text = "";
            }
            else
            {
                R_text.text = ChapterData.ChapterOrder + 1 + "";
                ChoiceRight.GetComponent <Image>().sprite = Resources.Load("UI/UIphoto/choiceMenuUI/chaptericon_" + (ChapterData.ChapterOrder + 1), typeof(Sprite)) as Sprite;
            }
        }
 private void Sceninfo()
 {
     var ChapterNum = TableDataExtension.GetTableData <DRScene>(601).ChapterNum;//场景601 测试
 }
示例#12
0
 // Use this for initialization
 private void Awake()
 {
     Data.GetInstance().SaveData_standAlone_Get();
     SceneData = TableDataExtension.GetTableData <DRScene>(Data.GetInstance().getcurrentSceneID());
 }
示例#13
0
 public int getmaxPassChapterID()
 {
     return(TableDataExtension.GetTableData <DRBattle>(Data.GetInstance().getmaxPassLevelID()).ChapterId);
 }
示例#14
0
 public int getmaxSceneID()
 {
     return(TableDataExtension.GetTableData <DRChapter>(Data.GetInstance().getmaxPassChapterID()).SceneId);
 }