/// <summary> 코스튬 획득 응답. </summary>
    public void OnReceiveGetCostume(NetData._CostumeData costumeData)
    {
        Transform  gridTf = ViewObj[(uint)ViewType.List].transform.FindChild("ScrollView/Grid");
        Transform  slotTf = gridTf.FindChild(string.Format("{0}", costumeData._costmeDataIndex));//gridTf.GetChild(SelectCostumeTfArr);
        GameObject eff    = UIHelper.CreateEffectInGame(slotTf, "Fx_UI_costume_select");

        Destroy(eff, 2f);
        //TempCoroutine.instance.FrameDelay()
        //CostumeListView();

        //아이템리스트에서 현재의 조각아이템을 찾아서 갯수를 가져온다 - 자주쓸거같으면 _Inventory안에 만들기
        //NetData._CostumeData costumeData = UserInfo.GetCostumeDataForLowDataID(costumeLowDataId);
        Item.CostumeInfo tempCos = costumeData.GetLowData();//_LowDataMgr.instance.GetLowDataCostumeInfo(costumeLowDataId);
        int shardCount           = UserInfo.GetItemCountForItemId(tempCos.ShardIdx, (byte)eItemType.USE);

        UILabel  nameAndStack = slotTf.FindChild("costume/name_and_stack_d1").GetComponent <UILabel>();
        UILabel  ability      = slotTf.FindChild("costume/ability_d1").GetComponent <UILabel>();
        UILabel  info         = slotTf.FindChild("costume/info_d1").GetComponent <UILabel>();
        UISprite icon         = slotTf.FindChild("costume/icon").GetComponent <UISprite>();

        NetData.ItemAbilityData abilityData = costumeData.AbilityData;
        float abilityValue = _LowDataMgr.instance.GetCostumeAbilityValue(costumeData._Grade, costumeData._MinorGrade, abilityData.Value);

        nameAndStack.text = string.Format("{0} ({1}/{2})", costumeData.GetLocName(), shardCount, costumeData._needShard);
        ability.text      = string.Format("{0} {1}", UIMgr.instance.GetAbilityLocName(abilityData.Ability)         //이름
                                          , UIMgr.instance.GetAbilityStrValue(abilityData.Ability, abilityValue)); //abilityData.Value * 0.1f));//지금 능력치

        info.text       = costumeData.GetDescription();
        icon.spriteName = costumeData.GetIconName();

        UIButton       uiBtnGet   = slotTf.FindChild("costume/BtnGet").GetComponent <UIButton>();
        UIEventTrigger uiTriMount = slotTf.FindChild("costume/BtnMount").GetComponent <UIEventTrigger>();
        GameObject     mountEff   = slotTf.FindChild("costume/mount_effect").gameObject;

        uiBtnGet.gameObject.SetActive(false);
        mountEff.SetActive(false);

        ///보유중
        uiTriMount.collider.enabled = true;
        uiTriMount.transform.GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(38);
        EventDelegate.Set(uiTriMount.onClick, delegate() { OnClickMountCostume(costumeData); });

        string msg = string.Format(_LowDataMgr.instance.GetStringCommon(832), costumeData.GetLocName());

        UIMgr.AddLogChat(msg);
    }
    public void OnPartnerFusion(uint lowDataId)
    {
        List <NetData._PartnerData> dataList = GetSortPartnerList();

        NetData._PartnerData partnerData = null;

        int count = dataList.Count;

        for (int i = 0; i < count; i++)
        {
            if (dataList[i]._partnerDataIndex != lowDataId)
            {
                continue;
            }

            CurPnDataArray = i;
            MovePartnerView();
            partnerData = dataList[i];
            break;
        }

        IsDuringEffect = true;
        ChangeInfoView(InfoViewType.SpawnInfo);

        Transform  tf    = InfoViewObj[(int)InfoViewType.SpawnInfo].transform.FindChild("root");
        GameObject go    = UIHelper.CreatePartnerUIModel(tf, partnerData._partnerDataIndex, 1, true, false, "PartnerPanel");
        UIModel    model = go.GetComponent <UIModel>();

        GameObject effGo = model.PlayIntro(SpawnEffectRoot, ParticleScale);

        if (effGo != null)
        {
            SpawnEffectRoot.localRotation = Quaternion.Euler(Vector3.zero);
        }
        else
        {
            effGo = Instantiate(SpawnEffectPrefab) as GameObject;
            SpawnEffectRoot.localRotation = Quaternion.Euler(new Vector3(20, 0, 0));
        }

        float delay = model.UnitAnim.GetAnimLength(eAnimName.Anim_intro) + 0.1f;

        TempCoroutine.instance.FrameDelay(delay, () =>
        {
            if (!IsDuringEffect)
            {
                return;
            }

            //Cam3D.rect = new Rect(Cam3DViewport, Cam3D.rect.y, Cam3D.rect.width, Cam3D.rect.height);
            SpawnEffectRoot.parent = transform;
            DestroyImmediate(effGo);
            IsDuringEffect = false;

            ///보유하고 있는 뷰로 이동시킨다.
            ChangeInfoView(InfoViewType.OwnInfo);
            OwnPartnerView.SetPartnerInfo(partnerData);
        });

        string msg = string.Format(_LowDataMgr.instance.GetStringCommon(833), partnerData.GetLocName());

        UIMgr.AddLogChat(msg);
    }
Exemplo n.º 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);
        }
    }