Exemple #1
0
    public static void GameOver(bool bTimeUp)
    {
        if (instance == null)
        {
            return;
        }

        instance.bPlaying = false;
        instance.tileSystem.GameOver();

        ScenesManager.SetEscapeMethod(null);

        SoundManager.GetInstance().FadeOutAndStopBGM(Define.SoundType.TickTock, 0.5f);
        SoundManager.GetInstance().FadeOutAndStopBGM(Define.SoundType.TickTockBack, 0.5f);
        SoundManager.GetInstance().FadeOutAndStopBGM(Define.SoundType.GameBGM, 0.5f);

        TimeUpPopup popup = PopupSystem.GetPopup <TimeUpPopup>(Define.PopupType.TimeUp);

        popup.SetData(bTimeUp, () =>
        {
            bool bShowContinue = DataManager.GetInstance().CanShowContinueVideo();
            if (bShowContinue && UnityAdsController.IsReady(Define.continueId))
            {
                ContinueDialog.SetData(bTimeUp);
                UISystem.OpenDialog(Define.DialogType.ContinueDialog);
            }
            else
            {
                UISystem.OpenDialog(Define.DialogType.ResultDialog);
            }
        });
        PopupSystem.OpenPopup(Define.PopupType.TimeUp);

        instance.uiSystem.GameOver();
    }
Exemple #2
0
    public override void BeforeOpen()
    {
        Vector3 pos;

        titleLabel.text   = DataManager.GetText(TextTable.shopTextKey);
        warningLabel.text = DataManager.GetText(TextTable.warningBuyKey);

        bool bFreeItem = DataManager.GetInstance().CanShowFreeCoinVideo();

        if (bFreeItem)
        {
            bFreeItem = UnityAdsController.IsReady(Define.freeCoinId);
        }

        for (int i = 0; i < 3; i++)
        {
            ShopItemPack item = shopItems[i];

            int value = 0;
            if (DataManager.GetInstance().TryGetProductValue(i, ref value))
            {
                item.coinLabel.text   = string.Format(DataManager.GetText(TextTable.luckyCountKey), value);
                item.buttonLabel.text = DataManager.GetText(TextTable.buyTextKey);
            }

            pos   = item.body.localPosition;
            pos.y = bFreeItem ? -350f : -270f;
            item.body.localPosition = pos;
        }

        freeItem.coinLabel.text = string.Format(DataManager.GetText(TextTable.freeCoinKey), DataManager.GetDesignValue(Define.GameDesign.FreeCoin));
        freeItem.body.gameObject.SetActive(bFreeItem);

        pos   = title.localPosition;
        pos.y = bFreeItem ? 366f : 286f;
        title.localPosition = pos;

        background.height = bFreeItem ? 880 : 720;

        pos   = warningBody.localPosition;
        pos.y = bFreeItem ? -400f : -320f;
        warningBody.localPosition = pos;

        int needCoin = DataManager.GetInstance().needCoinCount;

        if (needCoin > 0)
        {
            talkboxLabel.text = string.Format(DataManager.GetText(TextTable.notEnoughCoinKey), needCoin);
        }
        else if (bFreeItem)
        {
            talkboxLabel.text = DataManager.GetText(TextTable.hasFreeCoinKey);
        }
        else
        {
            talkboxLabel.text = DataManager.GetText(TextTable.wellcomeShopKey);
        }
    }
Exemple #3
0
 public void OnClickFreeVideo()
 {
     if (UnityAdsController.IsReady(Define.freeCoinId))
     {
         UnityAdsController.ShowAd(Define.freeCoinId, CallbackSuccess, CallbackSkip, CallbackSkip);
     }
     else
     {
         BasicPopup popup = PopupSystem.GetPopup <BasicPopup>(Define.PopupType.Basic);
         popup.SetData(DataManager.GetText(TextTable.errorVideKey));
         PopupSystem.OpenPopup(Define.PopupType.Basic);
     }
 }