示例#1
0
    public static void TryShowRewardedAd(ShopProductEntry shopProductEntry, ShopProductData shopProductData)
    {
#if GOOGLE_MOBILE_ADS
        // Get singleton reward based video ad reference.
        var rewardBasedVideo = RewardBasedVideoAd.Instance;

        if (Application.internetReachability == NetworkReachability.NotReachable)
        {
            ConfirmPopup.instance.Open(string.Format("\\인터넷 연결이 필요합니다.".Localized()));
        }
        else if (rewardBasedVideo.IsLoaded())
        {
            PlatformAdMobAds.shopProductEntry = shopProductEntry;
            PlatformAdMobAds.shopProductData  = shopProductData;
            SushiDebug.LogFormat("ShowRewardedAd: shopProductEntry: {0}", shopProductEntry);
            SushiDebug.LogFormat("ShowRewardedAd: shopProductData: {0}", shopProductData);
            rewardBasedVideo.Show();
        }
        else
        {
            Debug.LogError("Ad not ready!");
            ConfirmPopup.instance.Open(string.Format("\\광고가 아직 준비되지 않았습니다.".Localized()));
        }
#endif
    }
示例#2
0
 public static void HandleRewarded_Video(ShopProductEntry shopProductEntry, ShopProductData shopProductData,
                                         AdsType adsType)
 {
     SushiDebug.Log("The ad was successfully shown. (Video)");
     SushiDebug.LogFormat("HandleShowResult: shopProductEntry: {0}", shopProductEntry);
     SushiDebug.LogFormat("HandleShowResult: shopProductData: {0}", shopProductData);
     // 이번 스테이지를 처음부터 새로 시작한다.
     LoadStageFromStart(stageNumber);
 }
示例#3
0
 public static void HandleRewarded_RewardedVideo(ShopProductEntry shopProductEntry, ShopProductData shopProductData,
                                                 AdsType adsType)
 {
     SushiDebug.Log("The ad was successfully shown. (Rewarded Video)");
     SushiDebug.LogFormat("HandleShowResult: shopProductEntry: {0}", shopProductEntry);
     SushiDebug.LogFormat("HandleShowResult: shopProductData: {0}", shopProductData);
     // 체크포인트부터 이어서 플레이한다.
     // HotairBalloon.initialPositionY를 리셋하지 않으면
     // 이어서 되도록 해 놓았다.
     Bootstrap.ReloadCurrentScene();
 }
示例#4
0
    public static void TryShowRewardedAd(ShopProductEntry shopProductEntry, ShopProductData shopProductData)
    {
#if UNITY_ANDROID || UNITY_IOS
        TryShowAd("rewardedVideo", shopProductEntry, shopProductData,
                  new ShowOptions {
            resultCallback = HandleShowResult_RewardedVideo
        });
#else
        PlatformAds.HandleRewarded_RewardedVideo(shopProductEntry, shopProductData, PlatformAds.AdsType.UnityAds);
#endif
    }
示例#5
0
    public static void TryShowInterstitialAd(ShopProductEntry shopProductEntry, ShopProductData shopProductData,
                                             int stageNumber)
    {
        PlatformAds.stageNumber = stageNumber;
#if UNITY_ANDROID || UNITY_IOS
        TryShowAd("video", shopProductEntry, shopProductData,
                  new ShowOptions {
            resultCallback = HandleShowResult_Video
        });
#else
        PlatformAds.HandleRewarded_Video(shopProductEntry, shopProductData, PlatformAds.AdsType.UnityAds);
#endif
    }
示例#6
0
    public static void TryShowInterstitialAd(ShopProductEntry shopProductEntry, ShopProductData shopProductData,
                                             int stageNumber)
    {
        PlatformAds.stageNumber = stageNumber;
#if GOOGLE_MOBILE_ADS
        if (PlatformAdMobAdsInit.interstitial.IsLoaded())
        {
            PlatformAdMobAdsInit.interstitial.Show();
        }
        else
        {
            PlatformAds.HandleRewarded_Video(null, null, PlatformAds.AdsType.AdMob);
        }
#endif
    }
示例#7
0
 static void TryShowAd(string placementId, ShopProductEntry shopProductEntry, ShopProductData shopProductData,
                       ShowOptions options)
 {
     if (Application.internetReachability == NetworkReachability.NotReachable)
     {
         ConfirmPopup.instance.Open(string.Format("\\광고를 보기 위해서는 인터넷 연결이 필요합니다.".Localized()));
     }
     else if (Advertisement.IsReady(placementId))
     {
         PlatformUnityAds.shopProductEntry = shopProductEntry;
         PlatformUnityAds.shopProductData  = shopProductData;
         Advertisement.Show(placementId, options);
         BalloonSound.instance.StopTimeAndMuteAudioMixer();
     }
     else
     {
         Debug.LogError("Ad not ready! - " + placementId);
         ShowAdsErrorPopup();
     }
 }