Пример #1
0
    private List <NetData.MessInfo> FreeRoomList; //자유대전방리스트

    public override void Init()
    {
        base.Init();
        UserInfo = NetData.instance.GetUserInfo();
        string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), UserInfo._Level);

        LvName.text = string.Format("{0} {1}", lvStr, NetData.instance.Nickname);
        Attack.text = UserInfo.RefreshTotalAttackPoint().ToString();
        RoomList    = null;

        //상점
        EventDelegate.Set(BottomBtn[0].onClick, delegate() {
            base.Close();
            UIMgr.OpenShopPanel(this);
        });
        //코스튬
        EventDelegate.Set(BottomBtn[1].onClick, delegate()
        {
            base.Close();
            UIMgr.OpenCostume(this);
        });

        SetChannelActive();

        BottomBtn[2].isEnabled = 0 < QuickRoomId ? true : false;             //최소렙 못넘으면 빠른입장안대
        EventDelegate.Set(BottomBtn[2].onClick, delegate() { EnterGo(0); }); //빠른입장

        //내캐릭터
        NetData._CostumeData equipCostume = UserInfo.GetEquipCostume();
        CharModelTf.transform.gameObject.SetActive(true);

        uint weaponId = 0, clothId = 0, headId = 0;

        if (UserInfo.isHideCostum)
        {
            NetData._ItemData head   = UserInfo.GetEquipParts(ePartType.HELMET);
            NetData._ItemData cloth  = UserInfo.GetEquipParts(ePartType.CLOTH);
            NetData._ItemData weapon = UserInfo.GetEquipParts(ePartType.WEAPON);

            if (head != null)
            {
                headId = head._equipitemDataIndex;
            }

            if (cloth != null)
            {
                clothId = cloth._equipitemDataIndex;
            }

            if (weapon != null)
            {
                weaponId = weapon._equipitemDataIndex;
            }
        }


        UIHelper.CreatePcUIModel("FreefightPanel", CharModelTf, UserInfo.GetCharIdx(), headId, equipCostume._costmeDataIndex, clothId, weaponId, UserInfo.GetEquipSKillSet().SkillSetId, 3, UserInfo.isHideCostum, false);

        NetworkClient.instance.SendPMsgMessQueryC();//조회
        GetRoomList();
    }
    public override void Init()
    {
        SceneManager.instance.sw.Reset();
        SceneManager.instance.sw.Start();
        SceneManager.instance.showStopWatchTimer("ChapterPanel, Init() start");

        ChapterList     = new List <DataChapter>();
        HardChapterList = new List <DataChapter>();

        base.Init();
        SetDataTable(ChapterList, 0);
        SetDataTable(HardChapterList, 10000);

        InvenItemRewardSlot = new InvenItemSlotObject[3];
        for (int i = 0; i < RewardSlotRoot.Length; i++)
        {
            GameObject slotGo = Instantiate(InvenItemPrefab) as GameObject;
            Transform  tf     = slotGo.transform;
            tf.parent        = RewardSlotRoot[i];
            tf.localPosition = Vector3.zero;
            tf.localScale    = Vector3.one;

            InvenItemRewardSlot[i] = slotGo.GetComponent <InvenItemSlotObject>();
            InvenItemRewardSlot[i].EmptySlot();
        }

        UIHelper.CreateEffectInGame(BtnHard.transform.FindChild("On/eff").transform, "Fx_UI_HardMode_01");

        //이벤트 버튼 핸들러
        EventButton();
        StagePopup.PopupInit(this);
        CharInven = NetData.instance.GetUserInfo();
        PreAttack = (int)CharInven.RefreshTotalAttackPoint();

        List <NetData.StageStarRewardData> rewardList = CharInven.StageStarReward;

        for (int i = 0; i < ChapterList.Count; i++)// 갱신시켜주기
        {
            for (int j = 0; j < rewardList.Count; j++)
            {
                if (rewardList[j].ChapterID != ChapterList[i].number)
                {
                    continue;
                }
                if (rewardList[j].StageType != 1)
                {
                    continue;
                }

                ChapterList[i].GetClearGrade  = rewardList[j].Value;
                ChapterList[i].CurRewardBoxID = rewardList[j].BoxID;
            }
        }

        List <NetData.StageStarRewardData> hardRewardList = CharInven.HardStageStarReward;

        for (int i = 0; i < HardChapterList.Count; i++)// 갱신시켜주기
        {
            for (int j = 0; j < hardRewardList.Count; j++)
            {
                if (hardRewardList[j].ChapterID != HardChapterList[i].number)
                {
                    continue;
                }
                if (hardRewardList[j].StageType != 2)
                {
                    continue;
                }

                HardChapterList[i].GetClearGrade  = hardRewardList[j].Value;
                HardChapterList[i].CurRewardBoxID = hardRewardList[j].BoxID;
            }
        }

        for (int i = 0; i < BoxClickEffRoot.Length; i++)
        {
            UIHelper.CreateEffectInGame(BoxClickEffRoot[i].transform, "Fx_UI_chapter_box_open");
            BoxClickEffRoot[i].SetActive(false);
        }

        SceneManager.instance.showStopWatchTimer("ChapterPanel, Init() finish");

        //별보상 이펙트
        for (int i = 0; i < BoxEffRoot.Length; i++)
        {
            UIHelper.CreateEffectInGame(BoxEffRoot[i].transform, "Fx_UI_chapter_box_on");
            //if(i != 0)
            //    ResettingParticle(1.5f, UIHelper.FindComponents<ParticleSystem>(BoxEffRoot[i].transform), 0.5f);
        }

        //버튼글자가 한글자씩이라....따로적용
        //string normal = _LowDataMgr.instance.GetStringCommon(459);
        //string hard = _LowDataMgr.instance.GetStringCommon(9902);

        //BtnNormal.transform.FindChild("label_1").GetComponent<UILabel>().text = normal.Substring(0, 1);
        //BtnNormal.transform.FindChild("label_2").GetComponent<UILabel>().text = normal.Substring(1, 1);

        //BtnHard.transform.FindChild("On/label_1").GetComponent<UILabel>().text = hard.Substring(0, 1);
        //BtnHard.transform.FindChild("On/label_2").GetComponent<UILabel>().text = hard.Substring(1, 1);
        //BtnHard.transform.FindChild("Off/label_1").GetComponent<UILabel>().text = hard.Substring(0, 1);
        //BtnHard.transform.FindChild("Off/label_2").GetComponent<UILabel>().text = hard.Substring(1, 1);
    }
Пример #3
0
    public void NoticePop(NoticeType type, uint condition, string str, object obj)
    {
        Debug.Log(string.Format("<color=yellow>NoticePanel RunType={0}</color>", type));
        Transform typeTf    = NoticeGo[(int)type].transform;
        bool      notActive = false;

        switch (type)
        {
        case NoticeType.PowerUp:    //전투력
            NetData._UserInfo charInven = NetData.instance.GetUserInfo();
            if (charInven == null)
            {
                return;
            }

            int maxValue = (int)charInven.RefreshTotalAttackPoint(false);
            if (uiMgr.PrevAttack == maxValue)
            {
                return;
            }

            notActive = true;
            NoticeGo[(int)type].SetActive(true);

            _StatUpData.StatUpInit(uiMgr.PrevAttack, maxValue,
                                   StatUpLbl[0], typeTf.FindChild("effRoot"));

            int value = maxValue - uiMgr.PrevAttack;
            StatUpLbl[1].text = string.Format("{0}{1}[-]", value < 0 ? "[e84d29]" : "[FFFFFF]", value);

            uiMgr.PrevAttack = maxValue;
            break;

        case NoticeType.Achiev:    //업적

            string[] achievData = str.Split(',');
            AchieveType    = uint.Parse(achievData[0]);
            AchieveSubType = uint.Parse(achievData[1]);
            AchieveLv      = uint.Parse(achievData[2]);
            AchieveTabType = uint.Parse(achievData[3]);

            if (!TownState.TownActive)
            {
                return;
            }
            else
            {
                UIBasePanel gachaPanel = UIMgr.GetUIBasePanel("UIPanel/GachaPanel");
                if (gachaPanel != null && !(gachaPanel as GachaPanel).IsEndAni)
                {
                    return;
                }
            }

            notActive = true;
            break;

        case NoticeType.LevelUp:    //레벨업
            GameObject go = UIHelper.CreateEffectInGame(NoticeGo[(int)NoticeType.LevelUp].transform, "Fx_UI_levelup_01" + SystemDefine.LocalEff);
            Destroy(go, 2f);

            _LevelUpData.TimeInit(0, 2f);
            break;

        case NoticeType.Quest:    //퀘스트 클리어
            Quest.QuestInfo info = _LowDataMgr.instance.GetLowDataQuestData(condition);
            if (info == null)
            {
                return;
            }

            QuestLbl[0].text = info.Title;
            QuestLbl[1].text = info.LeftDescription;

            float            questDuration = 0;
            List <UITweener> tweenList     = UIHelper.FindComponents <UITweener>(typeTf);
            for (int i = 0; i < tweenList.Count; i++)
            {
                tweenList[i].ResetToBeginning();
                tweenList[i].PlayForward();
                if (questDuration < tweenList[i].delay + tweenList[i].duration)
                {
                    questDuration = tweenList[i].delay + tweenList[i].duration;
                }
            }

            _QuestData.TimeInit(0, questDuration);
            break;

        case NoticeType.Message:    //메세지
            string msg = null;
            if (0 < condition)
            {
                msg = _LowDataMgr.instance.GetStringCommon(condition);
            }
            else
            {
                msg = str;
            }

            for (int i = NoticeLbl.Length - 1; 0 < i; i--)
            {
                int arr = i - 1;
                NoticeLbl[i].color = NoticeLbl[arr].color;
                NoticeLbl[i].text  = NoticeLbl[arr].text;
                NoticeDelay[i]     = NoticeDelay[arr];
            }

            IsMsgUpdate        = true;
            NoticeDelay[0]     = 1;
            NoticeLbl[0].color = Color.white;
            NoticeLbl[0].text  = msg;
            break;

        case NoticeType.System:    //공지 시스템 메세지 처리
            MessageData systemData = new MessageData();
            systemData.MsgInit(str, SystemPos.duration + SystemPos.delay, SystemLbl, SystemPos);
            SystemList.Add(systemData);

            notActive = true;
            break;

        case NoticeType.Game:    //게임 알림(장비 습득 등) 메세지 처리
            MessageData gameData = new MessageData();
            gameData.MsgInit(str, GameOpenDuration + GameHideDuration + GameHideDelay, GameLbl, GameAlpha);
            gameData.SetAlphaData(GameOpenDuration, GameHideDuration, GameHideDelay);
            GameList.Add(gameData);

            notActive = true;
            break;

        case NoticeType.GetMailItem:    //우편함에서 얻은 아이템

            if (0 < condition)
            {
                Quest.QuestInfo lowData = _LowDataMgr.instance.GetLowDataQuestData(condition);

                if (0 < lowData.rewardGold)
                {
                    GetItemList.Add(new NetData.EmailAttachmentInfo((int)AssetType.Gold, (int)AssetType.Gold, lowData.rewardGold));
                }

                if (0 < lowData.rewardEnergy)
                {
                    GetItemList.Add(new NetData.EmailAttachmentInfo((int)AssetType.Energy, (int)AssetType.Energy, lowData.rewardEnergy));
                }

                if (0 < lowData.rewardExp)
                {
                    GetItemList.Add(new NetData.EmailAttachmentInfo((int)AssetType.Exp, (int)AssetType.Exp, lowData.rewardExp));
                }

                if (0 < lowData.rewardItem)
                {
                    GatchaReward.FixedRewardInfo gatcha = _LowDataMgr.instance.GetFixedRewardItem(lowData.rewardItem);
                    if (gatcha != null)
                    {
                        if (gatcha.ClassType != 99)
                        {
                            int classType = UIHelper.GetClassType(NetData.instance.GetUserInfo()._userCharIndex);
                            List <GatchaReward.FixedRewardInfo> gachaList = _LowDataMgr.instance.GetFixedRewardItemGroupList(lowData.rewardItem);
                            for (int i = 0; i < gachaList.Count; i++)
                            {
                                if (gachaList[i].ClassType != classType)
                                {
                                    continue;
                                }

                                GetItemList.Add(new NetData.EmailAttachmentInfo(gachaList[i].Type, gachaList[i].ItemId, gachaList[i].ItemCount));
                                break;
                            }
                        }
                        else
                        {
                            GetItemList.Add(new NetData.EmailAttachmentInfo(gatcha.Type, gatcha.ItemId, gatcha.ItemCount));
                        }
                    }
                }
            }
            else if (obj != null)
            {
                List <NetData.EmailAttachmentInfo> mailList = (List <NetData.EmailAttachmentInfo>)obj;
                GetItemList.AddRange(mailList);
            }

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

            TempCoroutine.instance.RemoveKeyDelay("GetMailItem");
            SoundManager.instance.PlaySfxSound(eUISfx.UI_reward_popup, false);
            break;

        case NoticeType.GetItem:    //획득 아이템 연출.
            GetItemData data;
            data.IconId  = condition;
            data.IsShard = (bool)obj;
            GetUseItemList.Add(data);
            notActive = true;

            if (_GetItemData.IsStart)    //이미 시작중이라면.
            {
                //NoticeGo[(int)NoticeType.GetItem].SetActive(true);
                bool      create = false;
                Transform itemTf = null;
                if (GetUseItemList.Count - 1 < typeTf.childCount)
                {
                    itemTf = typeTf.GetChild(GetUseItemList.Count - 1);
                }
                else
                {
                    itemTf               = Instantiate(typeTf.GetChild(0)) as Transform;
                    itemTf.parent        = typeTf;
                    itemTf.localPosition = Vector3.zero;
                    itemTf.localScale    = Vector3.one;

                    create = true;
                }

                itemTf.gameObject.SetActive(true);

                float            delay   = 0;
                List <UITweener> tweener = UIHelper.FindComponents <UITweener>(itemTf);
                for (int j = 0; j < tweener.Count; j++)
                {
                    if (create)
                    {
                        tweener[j].delay += (GetUseItemList.Count - 1) * 0.05f;
                    }
                    if (delay < tweener[j].duration + tweener[j].delay)
                    {
                        delay = tweener[j].duration + tweener[j].delay;
                    }

                    tweener[j].ResetToBeginning();
                    tweener[j].PlayForward();
                }

                UISprite sp = itemTf.FindChild("icon").GetComponent <UISprite>();
                sp.spriteName = _LowDataMgr.instance.GetLowDataIcon(data.IconId);
                sp.atlas      = AtlasMgr.instance.GetLoadAtlas(data.IsShard ? LoadAtlasType.Shard : LoadAtlasType.UseItem);

                _GetItemData.TimeInit(0, delay);
            }
            break;

        case NoticeType.Contents:
            uint   locKey   = 0;
            string iconName = null;
            switch ((OpenContentsType)condition)
            {
            case OpenContentsType.Char:         //오픈연출타입	캐릭터
                iconName = "costume_btn";
                locKey   = 65;
                break;

            case OpenContentsType.Achiev:         //오픈연출타입	업적
                iconName = "achi_btn";
                locKey   = 247;
                break;

            case OpenContentsType.Benefit:         //오픈연출타입	혜택
                iconName = "benefit_btn";
                locKey   = 681;
                break;

            case OpenContentsType.Social:         //오픈연출타입	소셜
                iconName = "social_btn";
                locKey   = 678;
                break;

            case OpenContentsType.Dungeon:         //오픈연출타입	컨텐츠
                iconName = "dungeon_btn";
                locKey   = 10;
                break;

            case OpenContentsType.Shop:         //오픈연출타입	상품
                iconName = "pvp_shop";
                locKey   = 462;
                break;

            case OpenContentsType.Partner:         //오픈연출타입	파트너
                iconName = "firend_btn";
                locKey   = 7;
                break;

            case OpenContentsType.FreeFight:         //오픈연출타입	난투장
                iconName = "free_btn";
                locKey   = 12;
                break;

            case OpenContentsType.Rank:         //오픈연출타입	랭킹
                iconName = "ranking_btn";
                locKey   = 161;
                break;

            case OpenContentsType.Guilde:         //오픈연출타입	길드
                iconName = "guild_btn";
                locKey   = 8;
                break;

            case OpenContentsType.Category:         //오픈연출타입	재화인벤
                iconName = "inven_btn";
                locKey   = 1287;
                break;

            case OpenContentsType.Chapter:         //오픈연출타입	재화인벤
                iconName = "adventure_btn";
                locKey   = 9;
                break;
            }

            string systemMsg = string.Format(_LowDataMgr.instance.GetStringCommon(9924), _LowDataMgr.instance.GetStringCommon(locKey));
            typeTf.FindChild("Icon").GetComponent <UISprite>().spriteName   = iconName;
            typeTf.FindChild("Icon/Label_01").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(locKey);
            typeTf.FindChild("Icon/Label_02").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(locKey);
            typeTf.FindChild("Txt_Title").GetComponent <UILabel>().text     = systemMsg;

            UIMgr.AddLogChat(systemMsg);

            SetRenderQueue renderQ = UIHelper.FindComponent <SetRenderQueue>(typeTf.FindChild("Effect"));
            if (renderQ != null)
            {
                renderQ.ResetRenderQ(GetComponent <UIPanel>().startingRenderQueue + 1);
            }

            UITweener openTween = typeTf.GetComponent <UITweener>();
            openTween.ResetToBeginning();
            openTween.PlayForward();

            break;
        }

        if (!notActive)
        {
            NoticeGo[(int)type].SetActive(true);
        }
    }