示例#1
0
    private void CallbackSkip()
    {
        BasicPopup popup = PopupSystem.GetPopup <BasicPopup>(Define.PopupType.Basic);

        popup.SetData(DataManager.GetText(TextTable.skipVideoKey));
        PopupSystem.OpenPopup(Define.PopupType.Basic);
    }
 private void onPrefabLoaded(string path, GameObject prefab)
 {
     popupObject = Object.Instantiate(prefab);
     if (IsCameraSpacePopup)
     {
         Service.Get <EventDispatcher>().DispatchEvent(new PopupEvents.ShowCameraSpacePopup(popupObject));
     }
     else
     {
         Service.Get <EventDispatcher>().DispatchEvent(new PopupEvents.ShowPopup(popupObject));
     }
     popup = popupObject.GetComponent <BasicPopup>();
     if (popup != null)
     {
         DBasicPopup data = default(DBasicPopup);
         data.PopupOffset    = PopupOffset;
         data.PopupScale     = PopupScale;
         data.ShowBackground = ShowBackground;
         popup.SetData(data);
         popup.EnableCloseButtons(ShowCloseButton, FullScreenClose);
         popup.DoneClose += onPopupClosed;
     }
     if (!WaitForPopupComplete)
     {
         Finish();
     }
 }
示例#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);
     }
 }
示例#4
0
    private void OnClickBuyButton(int idx)
    {
        string productKey = "";

        if (DataManager.GetInstance().TryGetProductKey(idx, ref productKey))
        {
            InAppPurchaser.BuyProduct(productKey, (string key) =>
            {
                int value = 0;
                if (DataManager.GetInstance().TryGetProductValue(key, ref value))
                {
                    UISystem.UpdateNews();

                    AddCoinPopup popup = PopupSystem.GetPopup <AddCoinPopup>(Define.PopupType.AddCoin);
                    popup.SetData(value);
                    PopupSystem.OpenPopup(Define.PopupType.AddCoin, OnCloseButton);

                    UnityEngine.Analytics.Analytics.CustomEvent("buy product", new Dictionary <string, object>
                    {
                        { productKey, key }
                    });
                }
                else
                {
                    BasicPopup popup = PopupSystem.GetPopup <BasicPopup>(Define.PopupType.Basic);
                    popup.SetData(DataManager.GetText(TextTable.errorBuyProductKey));
                    PopupSystem.OpenPopup(Define.PopupType.Basic);

                    UnityEngine.Analytics.Analytics.CustomEvent("product error", new Dictionary <string, object>
                    {
                        { productKey, key }
                    });
                }
            });
        }
    }