예제 #1
0
    public void RateAction()
    {
        if (ELSingleton <ApplicationSettings> .Instance.shopVersion == ShopVersion.GooglePlay)
        {
            Application.OpenURL("market://details?id=" + ELSingleton <XmlSettings> .Instance.rateItConfig.androidAppId);
        }
        else if (ELSingleton <ApplicationSettings> .Instance.shopVersion == ShopVersion.IOS)
        {
            Application.OpenURL("itms-apps://itunes.apple.com/app/id" + ELSingleton <XmlSettings> .Instance.rateItConfig.iosAppId + "?action=write-review");
        }
        if (!ELSingleton <RateUsManager> .Instance.consumed)
        {
            ELSingleton <CoinsManager> .Instance.AddCoins(ELSingleton <XmlSettings> .Instance.rateItConfig.coins);

            XmlSettings.IapConfig iapConfig = new XmlSettings.IapConfig();
            iapConfig.coins = ELSingleton <XmlSettings> .Instance.rateItConfig.coins;
            ELSingleton <IapManager> .Instance.CollectItems(iapConfig);
        }
        if (ELSingleton <RateUsPopUp> .Instance.isActiveAndEnabled)
        {
            ELSingleton <RateUsPopUp> .Instance.HidePopUp();
        }
        ELSingleton <RateUsManager> .Instance.Consume();

        ELSingleton <MenuWindow> .Instance.RateUsUpdate();
    }
예제 #2
0
    private void RewardedVideoAdReward(AdType aAdType)
    {
        switch (aAdType)
        {
        case AdType.BonusRoundReplay:
            ELSingleton <GameWindow> .Instance.LevelSuccessPopUpReplayButtonExecute();

            break;

        case AdType.DailyPuzzleReplay:
            ELSingleton <GameWindow> .Instance.LevelSuccessPopUpReplayButtonExecute();

            break;

        case AdType.FreeCoins:
        {
            ELSingleton <CoinsManager> .Instance.AddCoins(ELSingleton <XmlSettings> .Instance.rewardedVideoAdConfig.coins);

            XmlSettings.IapConfig iapConfig = new XmlSettings.IapConfig();
            iapConfig.coins = ELSingleton <XmlSettings> .Instance.rewardedVideoAdConfig.coins;
            ELSingleton <IapManager> .Instance.CollectItems(iapConfig);

            if (ELSingleton <ShopPopUp> .Instance.isActiveAndEnabled)
            {
                ELSingleton <ShopPopUp> .Instance.HidePopUp();
            }
            break;
        }
        }
    }
예제 #3
0
    public new void Prepare(XmlSettings.IapConfig iap)
    {
        base.Prepare(iap);
        int num = (iap.goodStart <= 0) ? ((iap.startFinish > 0) ? 1 : ((iap.expose > 0) ? 2 : 3)) : 0;

        hintIcon.sprite     = hintIcons[num];
        hintIconName.sprite = hintIconNames[num];
    }
예제 #4
0
    public void ShareAction()
    {
        AndroidJavaClass  androidJavaClass  = new AndroidJavaClass("android.content.Intent");
        AndroidJavaObject androidJavaObject = new AndroidJavaObject("android.content.Intent");

        androidJavaObject.Call <AndroidJavaObject>("setAction", new object[1]
        {
            androidJavaClass.GetStatic <string>("ACTION_SEND")
        });
        androidJavaObject.Call <AndroidJavaObject>("setType", new object[1]
        {
            "text/plain"
        });
        androidJavaObject.Call <AndroidJavaObject>("putExtra", new object[2]
        {
            androidJavaClass.GetStatic <string>("EXTRA_SUBJECT"),
            ELSingleton <LanguageSettings> .Instance.GetString(0)
        });
        androidJavaObject.Call <AndroidJavaObject>("putExtra", new object[2]
        {
            androidJavaClass.GetStatic <string>("EXTRA_TEXT"),
            ELSingleton <LanguageSettings> .Instance.GetString(1)
        });
        AndroidJavaObject @static            = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic <AndroidJavaObject>("currentActivity");
        AndroidJavaObject androidJavaObject2 = androidJavaClass.CallStatic <AndroidJavaObject>("createChooser", new object[2]
        {
            androidJavaObject,
            "Share Via"
        });

        @static.Call("startActivity", androidJavaObject2);
        if (ELSingleton <ShareManager> .Instance.HasCoinsReward())
        {
            ELSingleton <CoinsManager> .Instance.AddCoins(ELSingleton <XmlSettings> .Instance.shareConfig.coins);

            XmlSettings.IapConfig iapConfig = new XmlSettings.IapConfig();
            iapConfig.coins = ELSingleton <XmlSettings> .Instance.shareConfig.coins;
            ELSingleton <IapManager> .Instance.CollectItems(iapConfig);
        }
        if (ELSingleton <SharePopUp> .Instance.isActiveAndEnabled)
        {
            ELSingleton <SharePopUp> .Instance.HidePopUp();
        }
        ELSingleton <ShareManager> .Instance.Consume();

        ELSingleton <MenuWindow> .Instance.ShareUpdate();
    }
예제 #5
0
 public void Prepare(XmlSettings.IapConfig iap)
 {
     this.iap = iap;
     if (title != null)
     {
         title.text = ELSingleton <IapManager> .Instance.getName(iap.iap);
     }
     if (price != null)
     {
         price.text = ELSingleton <IapManager> .Instance.getPriceString(iap.iap);
     }
     if (coins != null)
     {
         coins.text = string.Concat(iap.coins);
     }
     if (goodStart != null)
     {
         goodStart.text = string.Concat(iap.goodStart);
     }
     if (startFinish != null)
     {
         startFinish.text = string.Concat(iap.startFinish);
     }
     if (expose != null)
     {
         expose.text = string.Concat(iap.expose);
     }
     if (tip != null)
     {
         tip.text = string.Concat(iap.tip);
     }
     if (hint != null)
     {
         hint.text = string.Concat(iap.tip + iap.goodStart + iap.startFinish + iap.expose);
     }
     if (noads != null)
     {
         noads.SetActive(iap.noads);
     }
     if (icon != null)
     {
         icon.sprite = icons[iap.icon];
         icon.SetNativeSize();
     }
 }
예제 #6
0
    public void CollectItems(XmlSettings.IapConfig iap)
    {
        ShopButton    shopButton    = null;
        CommonCoinPod commonCoinPod = null;
        MonoBehaviour monoBehaviour = null;
        Transform     transform     = null;

        if (ELSingleton <MenuWindow> .Instance.isActiveAndEnabled)
        {
            shopButton    = ELSingleton <MenuWindow> .Instance.shopButton;
            commonCoinPod = ELSingleton <MenuWindow> .Instance.coinPod;
            monoBehaviour = ELSingleton <MenuWindow> .Instance;
            transform     = ELSingleton <MenuWindow> .Instance.coinTarget.transform;
        }
        if (ELSingleton <GameWindow> .Instance.isActiveAndEnabled)
        {
            shopButton    = ELSingleton <GameWindow> .Instance.shopButton;
            commonCoinPod = ELSingleton <GameWindow> .Instance.coinPod;
            monoBehaviour = ELSingleton <GameWindow> .Instance;
            transform     = ELSingleton <GameWindow> .Instance.hintBar.transform;
        }
        if (ELSingleton <PackWindow> .Instance.isActiveAndEnabled)
        {
            shopButton    = ELSingleton <PackWindow> .Instance.shopButton;
            commonCoinPod = ELSingleton <PackWindow> .Instance.coinPod;
            monoBehaviour = ELSingleton <PackWindow> .Instance;
            transform     = ELSingleton <PackWindow> .Instance.coinTarget.transform;
        }
        if (shopButton != null && commonCoinPod != null)
        {
            if (iap.coins > 0)
            {
                shopButton.UpdateCoins(-iap.coins);
                commonCoinPod.ReleaseCoinsRadial(50, ELSingleton <MenuWindow> .Instance.transform.position, ELSingleton <MenuWindow> .Instance.coinTarget.transform.position, 1f, 2.2f, 2.2f, 0.5f, aIsFullUpdate: true, aIsWithParticles: false);
            }
            int num = Math.Sign(iap.expose) + Math.Sign(iap.goodStart) + Math.Sign(iap.startFinish) + Math.Sign(iap.tip);
            num = 30 / (num + 1);
            commonCoinPod.ReleaseCoinsRadialCustomImage(imageExpose, Math.Min(num, iap.expose), monoBehaviour.transform.position, transform.position, 1f, 0.9f, 0.9f, 0f);
            commonCoinPod.ReleaseCoinsRadialCustomImage(imageGoodStart, Math.Min(num, iap.goodStart), monoBehaviour.transform.position, transform.position, 1f, 0.9f, 0.9f, 0f);
            commonCoinPod.ReleaseCoinsRadialCustomImage(imageTip, Math.Min(num, iap.tip), monoBehaviour.transform.position, transform.position, 1f, 0.9f, 0.9f, 0f);
            commonCoinPod.ReleaseCoinsRadialCustomImage(imageStartFinish, Math.Min(num, iap.startFinish), monoBehaviour.transform.position, transform.position, 1f, 0.9f, 0.9f, 0f);
        }
    }