/// <summary>
    /// 켜져있는 객체를 끈다. POPUP_TYPE.READY_INFO일 경우에는 이전 뎁스로 이동시켜준다.
    /// ChapterPanel에서 사용한다.
    /// </summary>
    public byte OnClosePopup()
    {
        if (IsPopAction)
        {
            return(3);
        }

        if (CurPopupType == POPUP_TYPE.NONE)
        {
            return(0);                             //꺼져잇음
        }
        if (CurPopupType == POPUP_TYPE.STAGE_INFO) //스테이지 정보 화면에서는 객체를 끈다.
        {
            DisablePopup();
            Chapter.SetArrow();

            if (SceneManager.instance.CurTutorial == TutorialType.CHAPTER_HARD)
            {
                TutorialSupport su = GetStartTuto();
                if (su.IsEnable)
                {
                    su.SkipTuto();
                }
            }

            return(1);
        }
        else if (CurPopupType == POPUP_TYPE.SWEEP)
        {
            SetTypeEnablePopup(POPUP_TYPE.STAGE_INFO);
            return(2);
        }

        return(0);
    }
Example #2
0
    /// <summary> 튜토리얼 팝업 열기 </summary>
    static public TutorialPopup OpenTutorialPopup(int townTuto = -1, TutorialSupport obj = null)
    {
        string     path = "UIPopup/TutorialPopup";
        GameObject go   = UIMgr.Open(path, townTuto, obj);

        if (go != null)
        {
            return(go.GetComponent <TutorialPopup>());
        }

        return(null);
    }
    public void InitOutTutorial(TutorialSupport tutoObj)
    {
        if (IsHidePanel)
        {
            Show(null);
        }

        StopAllCoroutines();
        TutoSupport = tutoObj;
        CurSortId   = tutoObj.SortId + 1;
        Tutorial    = _LowDataMgr.instance.GetLowDataFirstMainTutorial((uint)CurType, (byte)tutoObj.SortId);//무조건 첫번째것부터 뽑아온다

        if (TutoSupport != null)
        {
            TargetPanel = TutoSupport.transform;
            BlockObj.SetActive(Tutorial.ProgressType == 0);
            //ReturnType = Tutorial.ProgressType == 0 ? PrevReturnType.Not : PrevReturnType.Close;
            DefaultData();
        }
    }
    /// <summary> 난이도에 따라 변경될 챕터들 </summary>
    void SetChapter(int chapterNum, bool leveldifficulty)
    {
        bool isPrevEnable = true;
        bool isNextEnable = true;
        List <DataChapter> chapterList = null;
        Transform          ChapterRoot;

        if (leveldifficulty)   //true일경우 Hard Chapter로.
        {
            ChapterRoot = HardChapterParent;
            chapterList = HardChapterList;
        }
        else  //false일경우 Normal Chapter로.
        {
            chapterList = ChapterList;
            ChapterRoot = ChapterParent;
        }

        //챕터 개수가 넘어가거나 모자를 경우의 예외처리.
        if (chapterList.Count <= chapterNum)
        {
            chapterNum   = (int)chapterList.Count;
            isNextEnable = false;
        }
        else if (chapterNum <= 1)
        {
            chapterNum   = 1;
            isPrevEnable = false;
        }
        ////4챕터까지만.. (판호용)
        //if (chapterNum >= 4)
        //    isNextEnable = false;

        //현제 보려는 챕터를 찾는다.
        for (int i = 0; i < chapterList.Count; i++)
        {
            if (chapterList[i].number != chapterNum)
            {
                continue;
            }
            else if (chapterList[i].stageList[0].State == -1)//진행 불가능한 스테이지
            {
                uiMgr.AddPopup(141, 761, 117);
                return;
            }

            CurChapter = chapterList[i];
            break;
        }

        //처음이거나 마지막 챕터일 경우 버튼을 꺼놓는다
        Btns[(uint)BUTTON_TYPE.PREV].gameObject.SetActive(isPrevEnable);
        Btns[(uint)BUTTON_TYPE.NEXT].gameObject.SetActive(isNextEnable);

        ChapterObject chap = null, changeChap = null;

        if (1 <= ChapterRoot.childCount)//이미 있는 챕터가 있다면 만들지 않는다.
        {
            string chapObj = leveldifficulty ? "HardChapter_0" : "Chapter_0";
            string path    = string.Format("UI/UIObject/{0}{1}", chapObj, chapterNum);

            //string path = string.Format("UI/UIObject/Chapter_0{0}", chapterNum);
            GameObject obj = ResourceMgr.Load(path) as GameObject;

            changeChap = obj.GetComponent <ChapterObject>();
            chap       = ChapterRoot.GetChild(0).GetComponent <ChapterObject>();
        }
        else//처음 시작했을 경우 실행됨.
        {
            GameObject go = UIHelper.CreateUIChapter(chapterNum, ChapterRoot, leveldifficulty);
            chap = go.GetComponent <ChapterObject>();
        }

        if (chap != null)           //없으면 오류
        {
            if (changeChap != null) //없을 수 있음
            {
                chap.ChangeLocalData(changeChap);
            }

            chap.SetChapter(CurChapter.stageList, OnClickStage, chapterNum.ToString());
            chap.gameObject.SetActive(true);
        }

        //별보상 셋팅
        SetGradeInfo();

        //진행중인 값 및 스테이지 셋팅
        CurChapterNum = chapterNum;

        BtnNormal.gameObject.SetActive(leveldifficulty);
        BtnHard.gameObject.SetActive(!leveldifficulty);

        bool activeHardMode = true;

        if (!leveldifficulty && CurChapter.stageList[9].State != 1)
        {
            activeHardMode = false;
        }


        BtnHard.transform.FindChild("On").gameObject.SetActive(activeHardMode);
        BtnHard.transform.FindChild("Off").gameObject.SetActive(!activeHardMode);

        /*
         * if (BtnHard.transform.FindChild("On").gameObject.activeSelf)
         * {
         *  //이펙트 껏다키면 안나오므로 다시생성해줌
         *  if(BtnHard.gameObject.activeSelf && BtnHard.transform.FindChild("On/eff").childCount>0)
         *  {
         *      DestroyImmediate(BtnHard.transform.FindChild("On/eff").GetChild(0).gameObject);
         *      UIHelper.CreateEffectInGame(BtnHard.transform.FindChild("On/eff"), "Fx_UI_HardMode_01");
         *  }
         * }
         */
        ChapterParent.gameObject.SetActive(!leveldifficulty);
        HardChapterParent.gameObject.SetActive(leveldifficulty);

        IsLevelHard = leveldifficulty;

        //챕터의 이름 셋팅
        ChapterNameLabel.text     = string.Format("{0}", CurChapter.name);
        HardChapterNameLabel.text = string.Format("{0}", CurChapter.name);

        NameRoot.transform.FindChild("normal").gameObject.SetActive(!leveldifficulty);
        NameRoot.transform.FindChild("Hard").gameObject.SetActive(leveldifficulty);

        /*
         * //현재 퀘스트에 던전입장이 걸려있는가?
         * Quest.QuestInfo quest = QuestManager.instance.GetCurrentQuest();
         * if (quest != null && quest.type == 1)
         * {
         *
         * }
         */
        if (leveldifficulty && SceneManager.instance.CurTutorial == TutorialType.CHAPTER_HARD)
        {
            TutorialSupport tuto      = StagePopup.GetStartTuto();
            TutorialSupport stageTuto = chap.StageObjs[0].GetComponent <TutorialSupport>();
            stageTuto.NextTuto = tuto;
            stageTuto.OnTutoSupportStart();

            tuto.TutoType = TutorialType.CHAPTER_HARD;
            tuto.SortId   = 4;
        }
    }
Example #5
0
    /// <summary> 칭호 보유중인거 서버에서 받음 </summary>
    public void OnPMsgReciveGetList(List <uint> getList)
    {
        List <Title.TitleInfo> list     = LowMgr.GetLowDataTitleList();
        List <Title.TitleInfo> sortList = new List <Title.TitleInfo>();

        int count = list.Count;

        if (getList.Count != list.Count)
        {
            int sortCount = 0;
            for (int i = 0; i < count; i++)
            {
                uint id    = list[i].Id;
                bool isAdd = false;
                for (int j = 0; j < getList.Count; j++)
                {
                    if (id != getList[j])
                    {
                        continue;
                    }

                    isAdd = true;
                    sortList.Insert(sortCount++, list[i]);
                }

                if (isAdd)
                {
                    continue;
                }

                if (list[i].TitleName == 1)
                {
                    sortList.Insert(0, list[i]);
                    sortCount++;
                }
                else
                {
                    sortList.Add(list[i]);
                }
            }
        }
        else
        {
            sortList = list;
        }

        list.Clear();

        int  leftCount = 0, rightCount = 0;
        bool isTutoSet = SceneManager.instance.CurTutorial == TutorialType.TITLE;

        for (int i = 0; i < count; i++)
        {
            Title.TitleInfo info = sortList[i];

            Transform parent = null, slotTf = null;
            if (info.Type == 1)//접두
            {
                parent = LeftGrid.transform;
                if (leftCount < parent.childCount)
                {
                    slotTf = parent.GetChild(leftCount);
                }
                ++leftCount;
            }
            else//접미
            {
                parent = RightGrid.transform;
                if (rightCount < parent.childCount)
                {
                    slotTf = parent.GetChild(rightCount);
                }
                ++rightCount;
            }

            if (slotTf == null)
            {
                slotTf               = Instantiate(parent.GetChild(0)) as Transform;
                slotTf.parent        = parent;
                slotTf.localPosition = Vector3.zero;
                slotTf.localScale    = Vector3.one;
                slotTf.gameObject.SetActive(true);
            }

            int arr = i + 1;
            slotTf.name = arr.ToString();

            uint idx   = info.Id;
            bool isGet = false;
            if (info.TitleName == 1)
            {
                isGet = true;
            }
            else
            {
                for (int j = 0; j < getList.Count; j++)
                {
                    if (getList[j].CompareTo(idx) != 0)
                    {
                        continue;
                    }

                    getList.RemoveAt(j);
                    isGet = true;
                    break;
                }
            }

            if (isGet && ((info.Type == 1 && SelectTitleL == info.Id) || (info.Type == 2 && SelectTitleR == info.Id)))
            {
                slotTf.FindChild("select").gameObject.SetActive(true);
            }
            else
            {
                slotTf.FindChild("select").gameObject.SetActive(false);
            }

            slotTf.GetComponent <UILabel>().text = LowMgr.GetLowDataTitleName(info.TitleName);
            slotTf.FindChild("on").gameObject.SetActive(isGet);
            slotTf.FindChild("off").gameObject.SetActive(!isGet);

            EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickTitleSlot(idx, arr);
            });

            if (isTutoSet && 0 < info.LinkAchievement)//isGet &&
            {
                isTutoSet = false;
                TutorialSupport support = slotTf.gameObject.AddComponent <TutorialSupport>();
                support.TutoType = TutorialType.TITLE;
                support.SortId   = 3;
                support.IsScroll = true;

                support.OnTutoSupportStart();
            }
        }

        //Destroy(LeftGrid.transform.GetChild(0).gameObject);
        //Destroy(RightGrid.transform.GetChild(0).gameObject);

        LeftGrid.repositionNow  = true;
        RightGrid.repositionNow = true;
        LeftGrid.transform.parent.GetComponent <UIScrollView>().ResetPosition();
        RightGrid.transform.parent.GetComponent <UIScrollView>().ResetPosition();
    }
    /// <summary>
    /// Partner를 셋팅 및 보여준다.
    /// </summary>
    /// <param name="type">PartnerType으로 타입에 맞게 보여줌</param>
    int OnTabPartnerList(int typeIdx)
    {
        PartnerClassType type = (PartnerClassType)typeIdx;
        int gridSlotCount     = 0;

        bool isTuto = SceneManager.instance.CurTutorial == TutorialType.PARTNER;
        List <NetData._PartnerData> dataList = CharInven.GetPartnerList();
        int loopCount = dataList.Count;

        for (int i = 0; i < loopCount; i++)
        {
            ListGridTf.GetChild(i).gameObject.SetActive(false);

            NetData._PartnerData    data = dataList[i];
            Partner.PartnerDataInfo info = data.GetLowData();
            if (type != PartnerClassType.None && (PartnerClassType)info.Class != type)
            {
                continue;
            }

            Transform slotTf = ListGridTf.GetChild(gridSlotCount);
            slotTf.gameObject.SetActive(true);


            slotTf.FindChild("Mark").GetComponent <UISprite>().spriteName = data.GetClassType();
            //보유조각수
            slotTf.FindChild("Txt_count").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(1154), data.NowShard, data._needShard);


            UISprite face = slotTf.FindChild("Itemroot/face").GetComponent <UISprite>();
            UISprite bg   = slotTf.FindChild("Itemroot/gradebg").GetComponent <UISprite>();
            face.spriteName = data.GetIcon();
            slotTf.FindChild("Txt_name").GetComponent <UILabel>().text = data.GetLocName();

            UILabel level = slotTf.FindChild("Txt_class").GetComponent <UILabel>();

            //등급은 색상도 고려해줘..
            UILabel gradeLabel = slotTf.FindChild("Txt_type").GetComponent <UILabel>();

            slotTf.FindChild("Itemroot/grade").GetComponent <UISprite>().spriteName = string.Format("Icon_0{0}", data.CurQuality);
            bg.spriteName = string.Format("Icon_bg_0{0}", data.CurQuality);

            Transform  btnGetTf    = slotTf.FindChild("Btn_Get");                 //소환버튼
            GameObject btnGetAfter = slotTf.FindChild("Btn_Getafter").gameObject; //보유중일때나옴
            btnGetAfter.SetActive(data._isOwn);
            btnGetTf.gameObject.SetActive(!data._isOwn);
            slotTf.FindChild("bg_on").gameObject.SetActive(data._isOwn);//배경

            if (data._isOwn)
            {
                EventDelegate.Set(btnGetAfter.GetComponent <UIEventTrigger>().onClick, delegate() {
                    UIMgr.instance.AddPopup(141, 1177, 117);    //보유중알림메시지
                });

                if (data._NowLevel >= data._MaxLevel)//최대렙
                {
                    level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1152), data._NowLevel);
                }
                else
                {
                    level.text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), data._NowLevel);
                }

                //색상도고려
                gradeLabel.text = string.Format("{0}{1}[-]", UIHelper.GetItemGradeColor((int)data.CurQuality), data.GetGradeName());
            }
            else
            {
                if (isTuto && type == PartnerClassType.Attack && data.NowShard >= data._needShard)
                {
                    isTuto = false;
                    TutorialSupport support = btnGetTf.gameObject.AddComponent <TutorialSupport>();
                    support.TutoType = TutorialType.PARTNER;
                    support.SortId   = 3;
                    support.IsScroll = true;

                    //support.NextTuto = OwnPartnerView.TabBtn[1].gameObject.GetComponent<TutorialSupport>();
                    support.OnTutoSupportStart();
                }

                btnGetTf.FindChild("Btn_on").gameObject.SetActive(data.NowShard >= data._needShard);
                btnGetTf.FindChild("Btn_off").gameObject.SetActive(data.NowShard < data._needShard);

                level.text      = "";
                gradeLabel.text = _LowDataMgr.instance.GetStringCommon(1155);                                                                   //없으면 미보유
                EventDelegate.Set(btnGetTf.GetComponent <UIEventTrigger>().onClick, delegate() { OnClickPartnerGet(data._partnerDataIndex); }); //소환
            }

            //슬롯 클릭시 실행할 함수 셋팅
            EventDelegate.Set(slotTf.GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickListSlot(data._partnerDataIndex);
            });

            ++gridSlotCount;
        }

        ListGridTf.GetComponent <UIGrid>().repositionNow = true;

        return(gridSlotCount);
    }
    public virtual bool OnSubTutorial()
    {
        if (SceneManager.instance.CurTutorial == TutorialType.ALL_CLEAR)
        {
            return(false);
        }

        if (TutoSupportList == null || TutoSupportList.Count <= 0)
        {
            TutoSupportList = UIHelper.FindComponents <TutorialSupport>(transform);

            for (int i = 0; i < TutoSupportList.Count; i++)
            {
                if (TutoSupportList[i].NextTuto != null)
                {
                    continue;
                }

                for (int j = 0; j < TutoSupportList.Count; j++)
                {
                    if (TutoSupportList[j].TutoType != TutoSupportList[i].TutoType)
                    {
                        continue;
                    }
                    else if (TutoSupportList[j].SortId != TutoSupportList[i].SortId + 1)
                    {
                        continue;
                    }

                    TutoSupportList[i].NextTuto = TutoSupportList[j];
                    break;
                }
            }
        }

        if (TutoSupportList.Count <= 0)
        {
            return(false);
        }

        int tutoType = 1;
        int arr      = 0;

        while (tutoType < (int)TutorialType.MAX)
        {
            if (TutoSupportList.Count <= arr)
            {
                arr = 0;
                ++tutoType;
            }
            TutorialSupport support = TutoSupportList[arr++];

            if (support.TutoType != SceneManager.instance.CurTutorial)
            {
                if (!support.ChangeTutoType() || support.TutoType != SceneManager.instance.CurTutorial)
                {
                    continue;
                }
            }
            Quest.MainTutorialInfo tutoLowData = _LowDataMgr.instance.GetLowDataFirstMainTutorial((uint)support.TutoType, 1);
            if (tutoLowData == null || NetData.instance.UserLevel < tutoLowData.OpenLevel)
            {
                continue;
            }

            if (support.OnTutoSupportStart())
            {
                return(true);
            }
        }
        return(false);
    }
Example #8
0
    public override void Init()
    {
        base.Init();

        TabGroup.Initialize(OnClickTab);

        int tutoSupportArr = 0;

        for (int i = 0; i < TabGroup.TabList.Count; i++)
        {
            if (TabGroup.TabList[i].GetComponent <TutorialSupport>() == null)
            {
                continue;
            }

            tutoSupportArr = i;
            break;
        }

        List <Item.CategoryListInfo> list = _LowDataMgr.instance.GetLowDataCategoryList();

        UIHelper.CreateSlotItem(true, list.Count, Scroll.GetChild(0), Scroll, (tf, arr) => {//타이틀, 아이템리스트 생성
            tf.FindChild("Title/txt").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon(list[arr].CategoryName);
            tf.FindChild("Title/desc").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(list[arr].CategoryDesc);
            if (arr < TabGroup.TabList.Count)
            {
                TabGroup.TabList[arr].GetComponent <UITabbase>().ChangeLabel(_LowDataMgr.instance.GetStringCommon(list[arr].CategoryName));
            }

            tf.name = string.Format("{0}", arr);
            Transform itemListTf     = tf.FindChild("ItemList");
            List <string> itemIdList = list[arr].ItemList.list;
            UIHelper.CreateSlotItem(true, itemIdList.Count, itemListTf.GetChild(0), itemListTf, (itemTf, itemArr) => {//아이템들 생성
                uint itemid = uint.Parse(itemIdList[itemArr]);
                SetItemSlot(itemid, itemTf);
                if (arr == tutoSupportArr && itemArr == 0)
                {
                    TutorialSupport support = itemTf.gameObject.AddComponent <TutorialSupport>();
                    support.TutoType        = TutorialType.CATEGORY;
                    support.SortId          = 3;
                    support.IsScroll        = true;
                }
            });

            itemListTf.GetComponent <UIGrid>().repositionNow = true;

            tf.FindChild("Title").GetComponent <UIWidget>().height = 190 + (110 * Mathf.RoundToInt((list[arr].ItemList.Count * 0.1f) - 0.5f));

            if (0 < arr)
            {
                //int line = 0;
                //if (1 <= list[arr - 1].ItemList.Count * 0.1f)
                //    line = list[arr - 1].ItemList.Count *0.1f;
                tf.localPosition = -new Vector3(0, -Scroll.GetChild(arr - 1).localPosition.y + Scroll.GetChild(arr - 1).FindChild("Title").GetComponent <UIWidget>().height, 0);
                //tf.localPosition = new Vector3(0, -((190 * arr) + (110 * line) ));
            }
            else
            {
                tf.localPosition = Vector3.zero;
            }
        });
    }