示例#1
0
 /// <summary>
 /// 交战标记
 /// </summary>
 /// <param name="section"></param>
 public void Indicate(LevelViewbs section)
 {
     if (section.isZeki)
     {
         arroParent_obj.transform.position = new Vector3(section.gameObject.transform.position.x, section.gameObject.transform.position.y + 1f, section.gameObject.transform.position.z);
     }
     else
     {
         arroParent_obj.transform.position = new Vector3(section.gameObject.transform.position.x, section.gameObject.transform.position.y + 0.8f, section.gameObject.transform.position.z);
     }
 }
示例#2
0
    public void _Init()
    {
        if (Lock_4 == null)
        {
            Lock_4  = Lock_4_obj.GetComponent <ButtonScale>();
            Lock_8  = Lock_8_obj.GetComponent <ButtonScale>();
            Lock_12 = Lock_12_obj.GetComponent <ButtonScale>();
        }
        LevelViewbs levelView = null;
        GameObject  name      = null;
        string      levelName = "";

        for (int idx = 0; idx < BattleMgr.Instance.Genlevel.Count; idx++)
        {
            if (idx > 0)
            {
                return;
            }
            switch (idx)
            {
            case 0:
                name = commonBack_obj;
                break;

            case 1:
                name = eliteBack_obj;
                break;

            case 2:
                name = epicBack_obj;
                break;
            }
            ChapterDic.Add(new List <GameObject>());
            for (int idx1 = 0; idx1 < BattleMgr.Instance.Genlevel[idx].Count; idx1++)
            {
                string chapter = string.Format("level_{0}", ((idx + 1) * 100 + (idx1 + 1)));
                ChapterDic[idx].Add(name.transform.Find(chapter).gameObject);
                for (int idx2 = 0; idx2 < BattleMgr.Instance.Genlevel[idx][idx1].GenStage.Count; idx2++)
                {
                    levelName = string.Format("stage_{0}", BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].LevelID);
                    string level = String.Concat(name.name, "/", chapter, "/level/", levelName);
                    levelView        = commonBack_obj.transform.parent.transform.Find(level).GetComponent <LevelViewbs>();
                    levelView.isZeki = BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].isZeki;
                    levelView.Init();
                    Genlevel.Add(BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].LevelID, levelView);
                    if (BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].StarCount != 0 || (idx == 0 && idx1 == 0 && idx2 == 0))
                    {
                        Genlevel[BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].LevelID].CloseBtn.enabled = true;
                        if (idx2 + 1 < BattleMgr.Instance.Genlevel[idx][idx1].GenStage.Count)
                        {
                            switch (idx)
                            {
                            case 0:
                                if (BattleMgr.Instance.NowLevelId >= 10301)
                                {
                                    break;
                                }
                                BattleMgr.Instance.NowLevelId = BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2 + 1].LevelID;
                                elite_tog.interactable        = true;
                                break;

                            case 1:
                                BattleMgr.Instance.EliteLevelId = BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2 + 1].LevelID;
                                epic_tog.interactable           = true;
                                break;

                            case 2:
                                BattleMgr.Instance.EpicLevelId = BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2 + 1].LevelID;
                                break;
                            }
                        }
                        else
                        {
                            if (idx1 + 1 >= BattleMgr.Instance.Genlevel[idx].Count)
                            {
                                break;
                            }
                            ;
                            if (BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage.Count == 0)
                            {
                                break;
                            }
                            switch (idx)
                            {
                            case 0:
                                for (int i = 0; i < BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage.Count; i++)
                                {
                                    BattleMgr.Instance.NowLevelId = BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage[0].LevelID;
                                    if (BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage[i].StarCount != 0)
                                    {
                                        BattleMgr.Instance.NowLevelId = BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage[i].LevelID;
                                    }
                                }
                                break;

                            case 1:
                                BattleMgr.Instance.EliteLevelId = BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage[0].LevelID;
                                break;

                            case 2:
                                BattleMgr.Instance.EpicLevelId = BattleMgr.Instance.Genlevel[idx][idx1 + 1].GenStage[0].LevelID;
                                break;
                            }
                        }

                        ChapterDic[idx][idx1].SetActive(true);
                        // battleName = ChapterDic[idx][idx1].transform.Find("battleName").gameObject;
                    }
                    else
                    {
                        Genlevel[BattleMgr.Instance.Genlevel[idx][idx1].GenStage[idx2].LevelID].CloseBtn.enabled = false;
                    }
                }
            }
        }
    }