Exemplo n.º 1
0
    //test
    public void start(Dictionary <string, P_Mission> data)
    {
        isPlaying = false;

        if (data == null)
        {
            return;
        }

        _queue.Clear();

        int i = 0;

        foreach (KeyValuePair <string, P_Mission> kv in data)
        {
            if (instance.gameObject.activeSelf == false)
            {
                instance.gameObject.SetActive(true);
            }

            P_MissionNotification n = new P_MissionNotification();
            n.id       = kv.Value.id;
            n.title    = kv.Value.title;
            n.desc     = kv.Value.desc;
            n.rewards  = kv.Value.rewards;
            n.category = kv.Value.category;

            ++i;
            _queue.Enqueue(n);
        }

        isPlaying = true;

        StartCoroutine(playMissionNoticePanel());
    }
    public void start(P_MissionNotification notiData, int index, bool isFinalNotice)
    {
        _isFinalNotice = isFinalNotice;

        panel.alpha = 0;

        if (notiData.desc == null)
        {
            isScarlet = false;
            setNormalData(notiData);
        }
        else
        {
            isScarlet = true;
            setNormalData(notiData);

            if (notiData.desc != null && lbDescription != null)
            {
                lbDescription.text = notiData.desc;
            }
        }

        if (cachedGameobject == null)
        {
            cachedGameobject = gameObject;
        }

        gameObject.SetActive(true);

        panel.depth = 100 + index;
        _state      = State.FadeIn;
    }
    void setNormalData(P_MissionNotification data)
    {
        lbTitle.text = data.title;

        switch (data.category)
        {
        case "HERO":
            spIcon.spriteName = "icn_quest_hero";
            break;

        case "EPIC":
            spIcon.spriteName = "icn_quest_epic";
            break;

        case "CHALL":
            spIcon.spriteName = "icn_quest_challenge";
            break;

        case "CHAMP":
            spIcon.spriteName = "icn_quest_champion";
            break;

        case "FRIEND":
            spIcon.spriteName = "icn_quest_friend";
            break;

        case "BUY":
            spIcon.spriteName = "icn_quest_shop";
            break;

        case "RUNE":
            spIcon.spriteName = "icn_quest_rune";
            break;

        case "ETC":
            spIcon.spriteName = "icn_quest_etc";
            break;
        }

        int rewardCount = 0;


        if (data.rewards != null)
        {
            rewardCount = data.rewards.Length;
        }

        int i = 0;

        bool hasGacha = false;

        foreach (P_Reward p in data.rewards)
        {
            if (i > 1)
            {
                break;
            }

            string iconId = null;

            switch (p.code)
            {
            case "FRPNT":
                iconId = WSDefine.ICON_HART;
                break;                //	우정포인트

            case "EXP":
                iconId = WSDefine.ICON_EXP;
                break;                //	경험치

            case "ENGY":
            case "ENERGY":
                iconId = WSDefine.ICON_ENERGY;
                break;                //	에너지

            case "GOLD":
                iconId = WSDefine.ICON_GOLD;
                break;                //	골드

            //			case "RST":
            //				iconId = WSDefine.ICON_RUNESTONE;
            //				break;//	룬스톤
            case "RUBY":
                iconId = WSDefine.ICON_RUBY;
                break;                //	루비

            case "RUNESTONE":
            case WSDefine.RUNESTONE:

                iconId = WSDefine.ICON_RUNESTONE;

                break;

            case "SML": break;            //	레전드 소환룬

            case "SMS": break;            //	슈퍼레어 소환룬

            case "SMR": break;            //	레어 소환룬

            case "SMN": break;            //	노말 소환룬

            case "SMALL": break;          //	레어도 랜덤 소환룬

            case "SKL": break;            //	레전드 스킬룬

            case "SKS": break;            //	슈퍼레어 스킬룬

            case "SKR": break;            //	레어 스킬룬

            case "SKM": break;            //	노말 스킬룬

            case "SKALL": break;          //	레어도 랜덤 스킬룬

            case "SMSLT": break;          //	소환룬 슬롯 활성화

            case "SKSLT": break;          //	소환룬 슬롯 활성화

            case WSDefine.REWARD_TYPE_GACHA:
                hasGacha = true;
                break;
            }

            if (iconId != null)
            {
                spRewardIcon[i].spriteName = iconId;
                lbRewardCount[i].text      = p.count + "";
                ++i;
            }
        }

        if (i == 1)
        {
            spRewardIcon[0].enabled = true;
            spRewardIcon[1].enabled = false;

            lbRewardCount[0].enabled = true;
            lbRewardCount[1].enabled = false;

            spRewardIcon[0].MakePixelPerfect();
        }
        else if (i == 2)
        {
            spRewardIcon[0].enabled = true;
            spRewardIcon[1].enabled = true;
            spRewardIcon[0].MakePixelPerfect();
            spRewardIcon[1].MakePixelPerfect();

            lbRewardCount[0].enabled = true;
            lbRewardCount[1].enabled = true;
        }
        else
        {
            spRewardIcon[0].enabled = false;
            spRewardIcon[1].enabled = false;

            lbRewardCount[0].enabled = false;
            lbRewardCount[1].enabled = false;
        }

        rewardItemSlot.gameObject.SetActive(hasGacha);
    }
Exemplo n.º 4
0
    IEnumerator playMissionNoticePanel()
    {
        int count = _queue.Count;
        int index = 0;

        isPlaying = true;

        bool normalNotice = true;

        while (_queue.Count > 0)
        {
            if (normalNotice)
            {
                yield return(new WaitForSeconds(delay));
            }
            else
            {
                yield return(new WaitForSeconds(delay2));
            }

            P_MissionNotification d = _queue.Dequeue();

            UIMissionClearNoticePanel p;

            normalNotice = (d.desc == null);

            if (normalNotice)
            {
                if (pool.Count > 0)
                {
                    p = pool.Pop();
                }
                else
                {
                    p = ((UIMissionClearNoticePanel)Instantiate(panel));
                    p.transform.parent = panel.transform.parent;
                }
            }
            else
            {
                if (pool2.Count > 0)
                {
                    p = pool2.Pop();
                }
                else
                {
                    p = ((UIMissionClearNoticePanel)Instantiate(panel2));
                    p.transform.parent        = panel2.transform.parent;
                    p.transform.localPosition = new Vector3(-4, -67, -163);
                }
            }


            p.start(d, index, _queue.Count == 0);

            p.animation.Play();

            ++index;
        }

        isPlaying = false;
    }