Пример #1
0
        public override IEnumerator OnEnter()
        {
            clickTime         = 0;
            cashNum           = MG_Manager.Instance.MG_PopCashPanel_Num;
            text_cashNum.text = (isPackB ? "$" : "") + MG_Manager.Get_CashShowText(cashNum);
            text_adtime.text  = "Remaining:" + MG_SaveManager.TodayExtraRewardTimes;
            StartCoroutine("AutoScaleLight");

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;
        }
Пример #2
0
        public override IEnumerator OnEnter()
        {
            yield return(null);

            canvasGroup.alpha          = 1;
            canvasGroup.blocksRaycasts = true;
            item0.RefreshProgress(MG_Manager.Instance.Get_Save_Diamond().ToString(), "5000000");
            item1.RefreshProgress(MG_Manager.Get_CashShowText(MG_Manager.Instance.Get_Save_Cash()), "100");
            item2.RefreshProgress(MG_Manager.Instance.Get_Save_Amazon().ToString(), "100");
            item3.RefreshProgress(MG_Manager.Instance.Get_Save_777().ToString(), "150");
            item4.RefreshProgress(MG_Manager.Instance.Get_Save_Fruits().ToString(), "200");
        }
Пример #3
0
        public override IEnumerator OnEnter()
        {
            clickTime = 0;
            trans_RandomSelect.localPosition = trans_AllRanomNum[0].localPosition;

            _rewardType    = MG_Manager.Instance.MG_PopDiceReward_Type;
            _rewardNum     = MG_Manager.Instance.MG_PopDiceReward_Num;
            _rewardMutiple = MG_Manager.Instance.MG_PopDiceReward_Mutiple;
            switch (_rewardType)
            {
            case MG_PopRewardPanel_RewardType.Gold:
                go_CashAll.SetActive(false);
                go_NotCashAll.SetActive(true);
                text_RewardNum.text = _rewardNum.ToString();
                btn_Close.gameObject.SetActive(true);
                btn_NormalGiveup.gameObject.SetActive(false);
                img_RewardIcon.sprite = sp_gold;
                StartCoroutine(DelayShow(img_Close));
                StartCoroutine("AutoRotateCardLight");
                break;

            case MG_PopRewardPanel_RewardType.Cash:
                go_CashAll.SetActive(true);
                go_NotCashAll.SetActive(false);
                bool packB = MG_Manager.Instance.Get_Save_PackB();
                text_RewardCashNum.text = (packB ? "$" : "") + MG_Manager.Get_CashShowText(_rewardNum);
                btn_Close.gameObject.SetActive(false);
                btn_NormalGiveup.gameObject.SetActive(true);
                img_RewardIcon.sprite = sp_cash;
                StartCoroutine(DelayShow(img_NormalGiveup));
                StartCoroutine("AutoScaleCardLight");
                break;
            }
            StartCoroutine("AutoShineSelect");

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;
        }
Пример #4
0
        public override IEnumerator OnEnter()
        {
            yield return(null);

            canvasGroup.alpha          = 1;
            canvasGroup.blocksRaycasts = true;
            text_num1.text             = "<color=#FF780E>" + MG_Manager.Instance.Get_Save_Gold() + "</color>/100M";
            text_num2.text             = "<color=#FF780E>" + MG_Manager.Instance.Get_Save_Diamond() + "</color>/5M";
            text_num3.text             = "<color=#FF780E>" + MG_Manager.Get_CashShowText(MG_Manager.Instance.Get_Save_Cash()) + "</color>/100";
            text_num4.text             = "<color=#FF780E>" + MG_Manager.Instance.Get_Save_Amazon() + "</color>/100";
            text_num5.text             = "<color=#FF780E>" + MG_Manager.Instance.Get_Save_777() + "</color>/150";
            text_num6.text             = "<color=#FF780E>" + MG_Manager.Instance.Get_Save_Fruits() + "</color>/200";
        }
Пример #5
0
        public override IEnumerator OnEnter()
        {
            bool needShowNothanks = false;

            RewardType      = MG_Manager.Instance.RewardType;
            RewardPanelType = MG_Manager.Instance.RewardPanelType;
            RewardNum       = MG_Manager.Instance.RewardNum;
            RewardMutiple   = MG_Manager.Instance.RewardMutiple;
            if (RewardType != MG_RewardType.Cash)
            {
                Debug.LogError("Show MG_CashReward Panel Error : rewardType is error.");
            }

            text_reaminTime.text = "Remaining:" + MG_SaveManager.TodayExtraRewardTimes;
            text_rewardnum.text  = MG_Manager.Get_CashShowText((int)(RewardNum * RewardMutiple));
            switch (RewardPanelType)
            {
            case MG_RewardPanelType.AdClaim:
                go_adicon.SetActive(true);
                needShowNothanks = true;
                text_get.text    = "      Save in wallet";
                break;

            case MG_RewardPanelType.AdRandom:
                go_adicon.SetActive(true);
                needShowNothanks = true;
                text_get.text    = "      Random x1~5";
                break;

            case MG_RewardPanelType.FreeMutipleClaim:
                go_adicon.SetActive(false);
                text_get.text = "Save in wallet";
                break;

            case MG_RewardPanelType.FreeClaim:
                go_adicon.SetActive(false);
                text_get.text = "Save in wallet";
                break;

            default:
                Debug.LogError("Show MG_CashReward Panel Error : panelType is error.");
                break;
            }
            StartCoroutine("AutoScaleLight");
            img_giveup.raycastTarget = false;
            img_giveup.color         = Color.clear;

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;
            MG_Manager.Instance.Play_Effect();
            if (needShowNothanks)
            {
                StartCoroutine("WaitShowNothanks");
            }
        }
Пример #6
0
 public void UpdateCashText()
 {
     text_Cash.text = MG_Manager.Get_CashShowText(MG_Manager.Instance.Get_Save_Cash());
 }
Пример #7
0
        public override IEnumerator OnEnter()
        {
            clickTime = 0;
            bool canSign = MG_Manager.Instance.Get_Save_WetherSign();

            if (list_alldays.Count != rewards.Length)
            {
                Debug.LogError("Set MG_Sign Reward Error : exist is not match config.");
            }
            else
            {
                int    lastSignDay         = MG_Manager.Instance.Get_Save_NextSignDay();
                string signState           = MG_SaveManager.SignState;
                bool   changeScratchTicket = false;
                if (lastSignDay >= 7)
                {
                    changeScratchTicket = true;
                    lastSignDay        %= 7;
                }
                for (int i = 0; i < 7; i++)
                {
                    Sprite bg;
                    Sprite reward;
                    string numDes;
                    char   state = signState[i];
                    bool   getAd = state == '1';
                    bool   hasGet;
                    if (i == lastSignDay && canSign)
                    {
                        bg     = i == 6 ? sp_today7Bg : sp_todayBg;
                        hasGet = false;
                    }
                    else if (i < lastSignDay)
                    {
                        bg     = sp_yestodayBg;
                        hasGet = true;
                    }
                    else
                    {
                        bg     = i == 6 ? sp_tomorrow7Bg : sp_tomorrowBg;
                        hasGet = false;
                    }

                    if (changeScratchTicket)
                    {
                        numDes = i < lastSignDay ? (getAd ? "5" : "1") : "?";
                        reward = sp_scratchTicket;
                    }
                    else
                    {
                        reward = (i == 6 ? sp_reawrd7 : (isGold[i] ? sp_gold : sp_cash));
                        if (isGold[i])
                        {
                            numDes = i < lastSignDay && getAd ? (rewards[i] * rewardmutiples[i]).ToString() : rewards[i].ToString();
                        }
                        else
                        {
                            numDes = i < lastSignDay ? (MG_Manager.Get_CashShowText(getAd ? (int)(rewards[i] * rewardmutiples[i]) : (int)rewards[i])) : "?";
                        }
                    }
                    list_alldays[i].SetDay(i + 1, hasGet, bg, reward, numDes);
                }
            }
            if (canSign)
            {
                cg_nothanks.alpha          = 0;
                cg_nothanks.blocksRaycasts = false;
                img_close.color            = Color.clear;
                img_close.raycastTarget    = false;
            }
            else
            {
                cg_nothanks.alpha          = 1;
                cg_nothanks.blocksRaycasts = true;
                img_close.color            = Color.white;
                img_close.raycastTarget    = true;
            }

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;

            if (canSign)
            {
                StartCoroutine("WaitShowNothanks");
            }
        }
Пример #8
0
        public override IEnumerator OnEnter()
        {
            clickTime = 0;
            go_Title.SetActive(false);
            go_Card.SetActive(false);
            go_Gift.SetActive(true);
            go_CashAll.SetActive(false);
            go_notice.SetActive(true);
            btn_Open.gameObject.SetActive(true);
            btn_Get.gameObject.SetActive(false);
            btn_Giveup.gameObject.SetActive(true);
            trans_GiftLight.gameObject.SetActive(true);
            text_rewardMutiple.gameObject.SetActive(false);
            StartCoroutine("DelayShowGiveup");
            StartCoroutine("AutoRotateGiftLight");
            _rewardType     = MG_Manager.Instance.MG_PopDiceReward_Type;
            _rewardNum      = MG_Manager.Instance.MG_PopDiceReward_Num;
            text_times.text = "Remaining:" + MG_SaveManager.TodayExtraRewardTimes.ToString();

            switch (_rewardType)
            {
            case MG_PopRewardPanel_RewardType.ExtraGold:
                text_times.gameObject.SetActive(true);
                text_rewardNum.text   = _rewardNum.ToString();
                img_RewardIcon.sprite = sp_gold;
                break;

            case MG_PopRewardPanel_RewardType.ExtraCash:
                text_times.gameObject.SetActive(true);
                if (isPackB)
                {
                    text_rewardCashNum.text = "$" + MG_Manager.Get_CashShowText(_rewardNum);
                }
                else
                {
                    text_rewardCashNum.text = MG_Manager.Get_CashShowText(_rewardNum);
                }
                break;

            case MG_PopRewardPanel_RewardType.SignGold:
                _rewardNum              = MG_Manager.Instance.MG_SignRewardNum;
                _rewardMutiple          = MG_Manager.Instance.MG_SignRewardMutiple;
                text_rewardNum.text     = _rewardNum.ToString();
                text_rewardMutiple.text = "<size=150><color=#FFE100>x" + _rewardMutiple + "</color></size>";
                img_RewardIcon.sprite   = sp_gold;
                text_times.gameObject.SetActive(false);
                go_Title.SetActive(true);
                go_Gift.SetActive(false);
                go_Card.SetActive(true);
                text_rewardMutiple.gameObject.SetActive(true);
                btn_Open.gameObject.SetActive(false);
                btn_Get.gameObject.SetActive(true);
                btn_Giveup.gameObject.SetActive(false);
                go_notice.SetActive(false);
                break;

            case MG_PopRewardPanel_RewardType.SignCash:
                _rewardNum     = MG_Manager.Instance.MG_SignRewardNum;
                _rewardMutiple = MG_Manager.Instance.MG_SignRewardMutiple;
                if (isPackB)
                {
                    text_rewardCashNum.text = "$" + MG_Manager.Get_CashShowText((int)(_rewardNum * _rewardMutiple));
                }
                else
                {
                    text_rewardCashNum.text = MG_Manager.Get_CashShowText((int)(_rewardNum * _rewardMutiple));
                }
                text_times.gameObject.SetActive(false);
                go_CashAll.SetActive(true);
                go_Title.SetActive(false);
                go_Gift.SetActive(false);
                go_Card.SetActive(false);
                btn_Open.gameObject.SetActive(false);
                btn_Get.gameObject.SetActive(true);
                btn_Giveup.gameObject.SetActive(false);
                go_notice.SetActive(false);
                trans_GiftLight.gameObject.SetActive(false);
                StartCoroutine("AutoScaleLight");
                break;
            }

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;
        }
Пример #9
0
        public override IEnumerator OnEnter()
        {
            clickTime = 0;
            bool canSign = MG_Manager.Instance.Get_Save_WetherSign();

            if (list_alldays.Count != rewards.Length)
            {
                Debug.LogError("Set MG_Sign Reward Error : exist is not match config.");
            }
            else
            {
                int    lastSignDay         = MG_Manager.Instance.Get_Save_NextSignDay();
                string signState           = MG_Manager.Instance.Get_Save_SignStatePerDay();
                bool   changeScratchTicket = false;
                if (lastSignDay >= 7)
                {
                    changeScratchTicket = true;
                    lastSignDay        %= 7;
                }
                for (int i = 0; i < 7; i++)
                {
                    Sprite bg;
                    char   state = signState[i];
                    bool   getAd = state == '1';
                    if (i == lastSignDay && canSign)
                    {
                        bg = sp_thisBg;
                    }
                    else if (i < lastSignDay)
                    {
                        bg = sp_lastBg;
                    }
                    else
                    {
                        bg = sp_nextBg;
                    }
                    if (changeScratchTicket)
                    {
                        if (i < lastSignDay)
                        {
                            list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_scratchTicket, getAd ? "5" : "1", canSign);
                        }
                        else
                        {
                            list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_scratchTicket, "?", canSign);
                        }
                    }
                    else
                    {
                        if (isGold[i])
                        {
                            if (i < lastSignDay)
                            {
                                list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_gold, getAd ? (rewards[i] * rewardmutiples[i]).ToString() : rewards[i].ToString(), canSign);
                            }
                            else
                            {
                                list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_gold, rewards[i].ToString(), canSign);
                            }
                        }
                        else
                        {
                            if (i < lastSignDay)
                            {
                                list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_cash, MG_Manager.Get_CashShowText(getAd ? (int)(rewards[i] * rewardmutiples[i]) : (int)rewards[i]), canSign);
                            }
                            else
                            {
                                list_alldays[i].SetDay(i + 1, lastSignDay, bg, sp_cash, "?", canSign);
                            }
                        }
                    }
                }
            }

            Transform transAll = transform.GetChild(1);

            transAll.localScale        = new Vector3(0.8f, 0.8f, 1);
            canvasGroup.alpha          = 0.8f;
            canvasGroup.blocksRaycasts = true;
            while (transAll.localScale.x < 1)
            {
                yield return(null);

                float addValue = Time.unscaledDeltaTime * 2;
                transAll.localScale += new Vector3(addValue, addValue);
                canvasGroup.alpha   += addValue;
            }
            transAll.localScale      = Vector3.one;
            canvasGroup.alpha        = 1;
            canvasGroup.interactable = true;
        }