Пример #1
0
 public static void InitializeRewardedAdSystem(string[] adUnits)
 {
     if (Application.isEditor)
     {
         return;
     }
     MCAdsBinding.LogInfo(MethodBase.GetCurrentMethod().Name);
     MCAdsBinding.GetAdvertisingId();
     if (adUnits.Length < 1)
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
         return;
     }
     if (adUnits.Length > 0)
     {
         string text = adUnits[0];
         for (int i = 1; i < adUnits.Length; i++)
         {
             text = text + "," + adUnits[i];
         }
         MCAdsBinding._plugin.Call("initializeRewardedAdSystem", new object[]
         {
             text
         });
     }
 }
Пример #2
0
 public static string GetMCAdsUnityPluginVersion()
 {
     if (Application.isEditor)
     {
         return("MC ADS UNITY PLUGIN VERSION");
     }
     return(MCAdsBinding.GetMCAdsSDKVersion());
 }
Пример #3
0
 public static void SetRewardedVideoParentalGateType(MPRewardedVideoParentalGateType type)
 {
     if (Application.isEditor)
     {
         return;
     }
     MCAdsBinding.LogInfo("SetRewardedVideoParentalGateType() type set to: " + type.ToString());
 }
Пример #4
0
 public static string GetDeviceType()
 {
     if (Application.isEditor)
     {
         return("EDITOR");
     }
     MCAdsBinding.LogInfo(MethodBase.GetCurrentMethod().Name);
     return(MCAdsBinding._plugin.Call <string>("getDeviceType", new object[0]));
 }
Пример #5
0
 public static string GetAdvertisingId()
 {
     if (Application.isEditor)
     {
         return(string.Empty);
     }
     MCAdsBinding.LogInfo(MethodBase.GetCurrentMethod().Name);
     return(MCAdsBinding._plugin.Call <string>("getGIDA", new object[0]));
 }
Пример #6
0
 public static void SetGuestPreferredLanguage(string languageCode)
 {
     if (Application.isEditor)
     {
         return;
     }
     MCAdsBinding.LogInfo("SetGuestPreferredLanguage() languageCode set to: " + languageCode);
     MCAdsBinding._plugin.Call("setGuestPreferredLanguage", new object[]
     {
         languageCode
     });
 }
Пример #7
0
 public static void SetGuestIsPayer(bool isPayer)
 {
     if (Application.isEditor)
     {
         return;
     }
     MCAdsBinding.LogInfo("SetGuestIsPayer() isPayer set to: " + isPayer.ToString());
     MCAdsBinding._plugin.Call("setGuestIsPayer", new object[]
     {
         isPayer
     });
 }
Пример #8
0
 public static bool IsRewardedVideoReady(string adUnitId)
 {
     if (Application.isEditor)
     {
         return(false);
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     return(MCAdsBinding._plugin.Call <bool>("isRewardedVideoReady", new object[]
     {
         adUnitId
     }));
 }
Пример #9
0
 public static void CallNativeAdTrackClick(string adUnitId)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("callNativeAdTrackClick", new object[]
     {
         adUnitId
     });
 }
Пример #10
0
 public static string GetNativeAdClickURL(string adUnitId)
 {
     if (Application.isEditor)
     {
         return(string.Empty);
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     return(MCAdsBinding._plugin.Call <string>("getNativeAdClickURL", new object[]
     {
         adUnitId
     }));
 }
Пример #11
0
 public static void ShowInterstitialAd(string adUnitId)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("showInterstitial", new object[]
     {
         adUnitId
     });
 }
Пример #12
0
 public static void DestroyBanner(string adUnitId)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("destroyBanner", new object[]
     {
         adUnitId
     });
 }
Пример #13
0
 public static void SetAutoRefreshBannerEnabled(string adUnitId, bool enabled)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("setAutorefreshEnabled", new object[]
     {
         adUnitId,
         enabled
     });
 }
Пример #14
0
 public static void RequestRewardedVideo(string adUnitId, string keywords)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("requestRewardedVideo", new object[]
     {
         adUnitId,
         keywords
     });
 }
Пример #15
0
 public static void ShowBanner(string adUnitId, bool shouldShow = true)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("hideBanner", new object[]
     {
         adUnitId,
         !shouldShow
     });
 }
Пример #16
0
 public static void SetGuestAge(int age)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (age < 0)
     {
         MCAdsBinding.LogWarning("SetGuestAge() called with negative age: " + age.ToString());
     }
     else
     {
         MCAdsBinding.LogInfo("SetGuestAge() age set to: " + age.ToString());
     }
     MCAdsBinding._plugin.Call("setGuestAge", new object[]
     {
         age
     });
 }
Пример #17
0
 public static void CreateBanner(string adUnitId, MCAdsAdPlacement position = MCAdsAdPlacement.Custom, MCAdsBannerType size = MCAdsBannerType.Size320x50, string keywords = "", int marginTop = 0, int marginLeft = 0, int customBannerWidth = 0, int customBannerHeight = 0)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (string.IsNullOrEmpty(adUnitId))
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     MCAdsBinding._plugin.Call("showBanner", new object[]
     {
         (int)size,
         (int)position,
         adUnitId,
         keywords,
         marginTop,
         marginLeft,
         customBannerWidth,
         customBannerHeight
     });
 }
Пример #18
0
 public static void InitializeInterstitialAdSystem(string[] adUnits)
 {
     if (Application.isEditor)
     {
         return;
     }
     if (adUnits == null || adUnits.Length == 0)
     {
         MCAdsBinding.LogMissingAdUnitID(MethodBase.GetCurrentMethod().Name);
     }
     if (adUnits.Length > 0)
     {
         string text = adUnits[0];
         for (int i = 1; i < adUnits.Length; i++)
         {
             text = text + "," + adUnits[i];
         }
         MCAdsBinding._plugin.Call("initializeInterstitialAdSystem", new object[]
         {
             text
         });
     }
 }
Пример #19
0
 private static void LogMissingAdUnitID(string function)
 {
     MCAdsBinding.LogError(function + "() missing ad unit ID!");
 }
Пример #20
0
 public static void HideBanner(string adUnitId)
 {
     MCAdsBinding.ShowBanner(adUnitId, false);
 }
Пример #21
0
 public static void InitializeRewardedVideo(string[] adUnits)
 {
     MCAdsBinding.InitializeRewardedAdSystem(adUnits);
 }
Пример #22
0
 public static string GetGIDA()
 {
     return(MCAdsBinding.GetAdvertisingId());
 }
Пример #23
0
 public static void SetLogLevel(MCAdsLogging.LogLevel level)
 {
     MCAdsLogging._logLevel = level;
     MCAdsBinding.SetLogLevel(level);
     MCAdsLogging.Log("log level set to: " + level.ToString(), MCAdsLogging.LogLevel.Verbose);
 }
Пример #24
0
 public static void InitializeInterstitials(string[] adUnits)
 {
     MCAdsBinding.InitializeInterstitialAdSystem(adUnits);
 }