Exemplo n.º 1
0
    // Create a banner view and add it into the view hierarchy.
    public static void CreateBannerView(string publisherId, AdSize adSize, bool positionAtTop)
    {
		AndroidJavaClass playerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject activity = playerClass.GetStatic<AndroidJavaObject>("currentActivity");
		AndroidJavaClass pluginClass = new AndroidJavaClass("com.google.unity.AdMobPlugin");
        pluginClass.CallStatic("createBannerView",
			new object[4] {activity, publisherId, adSize.ToString(), positionAtTop});
    }
Exemplo n.º 2
0
 // Create a GADBannerView and adds it into the view hierarchy.
 public static void CreateBannerView(string publisherId, AdSize adSize, bool positionAtTop)
 {
     // Call plugin only when running on real device.
     if (Application.platform == RuntimePlatform.OSXEditor)
     {
         return;
     }
     AdMobMobilePlugin.CreateBannerView(publisherId, adSize.ToString(), positionAtTop);
 }
Exemplo n.º 3
0
 // Create a GADBannerView and adds it into the view hierarchy.
 public static void CreateBannerView(string publisherId, AdSize adSize, bool positionAtTop)
 {
     // Call plugin only when running on real device.
     if (Application.isEditor)
     {
         return;
     }
     _CreateBannerView(publisherId, adSize.ToString(), positionAtTop);
 }
Exemplo n.º 4
0
 // Create a GADBannerView and adds it into the view hierarchy.
 public static void CreateBannerView(string publisherId, AdSize adSize, bool positionAtTop)
 {
     // Call plugin only when running on real device.
     if (Application.platform == RuntimePlatform.OSXEditor)
     {
         return;
     }
     AdMobMobilePlugin.CreateBannerView(publisherId, adSize.ToString(), positionAtTop);
 }
Exemplo n.º 5
0
    // Create a banner view and add it into the view hierarchy.
    public static void CreateBannerView(string publisherId, AdSize adSize, bool positionAtTop)
    {
        AndroidJavaClass  playerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject activity    = playerClass.GetStatic <AndroidJavaObject>("currentActivity");
        AndroidJavaClass  pluginClass = new AndroidJavaClass(PluginClassName);

        pluginClass.CallStatic("createBannerView",
                               new object[4] {
            activity, publisherId, adSize.ToString(), positionAtTop
        });
    }
Exemplo n.º 6
0
    /// <summary>
    /// Bind this instance.
    /// </summary>
    public void CreateBanner(string adUnitId, AdSize adSize, bool isTopPosition) {
#if UNITY_ANDROID
        plugin = new AndroidJavaObject(
			CLASS_NAME,
			new AndroidJavaClass("com.unity3d.player.UnityPlayer")
				.GetStatic<AndroidJavaObject>("currentActivity"),
			adUnitId,
			adSize.ToString(),
			isTopPosition,
			gameObject.name);
#endif
    }
Exemplo n.º 7
0
	/// <summary>
	/// Bind this instance.
	/// </summary>
	public void CreateBanner(string adUnitId, AdSize adSize, bool isTopPosition=true, string interstitialId="", bool isTestDevice=false) {
		if (String.IsNullOrEmpty(interstitialId)) {
			interstitialId = "";
		}

#if UNITY_ANDROID && !UNITY_EDITOR
		plugin = new AndroidJavaObject(
			CLASS_NAME,
			new AndroidJavaClass("com.unity3d.player.UnityPlayer")
				.GetStatic<AndroidJavaObject>("currentActivity"),
			adUnitId,
			adSize.ToString(),
			isTopPosition,
			interstitialId,
			gameObject.name,
			isTestDevice);
#endif
	}
Exemplo n.º 8
0
    /// <summary>
    /// Bind this instance.
    /// </summary>
    public void CreateBanner(string adUnitId, AdSize adSize, bool isTopPosition = true, string interstitialId = "", bool isTestDevice = false)
    {
        if (String.IsNullOrEmpty(interstitialId))
        {
            interstitialId = "";
        }

#if UNITY_ANDROID && !UNITY_EDITOR
        plugin = new AndroidJavaObject(
            CLASS_NAME,
            new AndroidJavaClass("com.unity3d.player.UnityPlayer")
            .GetStatic <AndroidJavaObject>("currentActivity"),
            adUnitId,
            adSize.ToString(),
            isTopPosition,
            interstitialId,
            gameObject.name,
            isTestDevice);
#endif
    }