Exemplo n.º 1
0
/*
 *       private void preInitAdmob(){
 *          if (jadmob == null) {
 *              AndroidJavaClass admobUnityPluginClass = new AndroidJavaClass("com.admob.plugin.AdmobUnityPlugin");
 *              jadmob = admobUnityPluginClass.CallStatic<AndroidJavaObject>("getInstance");
 *              InnerAdmobListener innerlistener = new InnerAdmobListener();
 *              innerlistener.admobInstance = this;
 *              AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
 *              AndroidJavaObject activy = jc.GetStatic<AndroidJavaObject>("currentActivity");
 *
 *              jadmob.Call("setContext", new object[] { activy, new AdmobListenerProxy(innerlistener) });
 *                      }
 *              }
 */
        private void preInitAdmob()
        {
            if (jadmob == null)
            {
                AndroidJavaClass admobUnityPluginClass = new AndroidJavaClass("com.admob.plugin.AdmobUnityPlugin");
                jadmob = admobUnityPluginClass.CallStatic <AndroidJavaObject>("getInstance");
                InnerAdmobListener innerlistener = new InnerAdmobListener();
                innerlistener.admobInstance = this;
                jadmob.Call("setContext", new object[] { new AdmobListenerProxy(innerlistener) });
            }
        }
Exemplo n.º 2
0
        private void preInitAdmob()
        {
            if (jadmob == null)
            {
                AndroidJavaClass admobUnityPluginClass = new AndroidJavaClass("com.admob.plugin.AdmobUnityPlugin");
                jadmob = admobUnityPluginClass.CallStatic <AndroidJavaObject>("getInstance");
                InnerAdmobListener innerlistener = new InnerAdmobListener();
                innerlistener.admobInstance = this;
                AndroidJavaClass  jc     = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
                AndroidJavaObject activy = jc.GetStatic <AndroidJavaObject>("currentActivity");

                jadmob.Call("setContext", new object[] { activy, new AdmobListenerProxy(innerlistener) });
            }
        }
Exemplo n.º 3
0
 private void preInitAdmob()
 {
     if (jadmob == null) {
         AndroidJavaClass admobUnityPluginClass = new AndroidJavaClass("com.admob.plugin.AdmobUnityPlugin");
         jadmob = admobUnityPluginClass.CallStatic<AndroidJavaObject> ("getInstance");
         InnerAdmobListener innerlistener = new InnerAdmobListener();
         innerlistener.admobInstance = this;
         jadmob.Call("setListener", new AdmobListenerProxy(innerlistener));
     }
 }
Exemplo n.º 4
0
         private void preInitAdmob(){
            if (jadmob == null) {
                AndroidJavaClass admobUnityPluginClass = new AndroidJavaClass("com.admob.plugin.AdmobUnityPlugin");
                jadmob = admobUnityPluginClass.CallStatic<AndroidJavaObject>("getInstance");
                InnerAdmobListener innerlistener = new InnerAdmobListener();
                innerlistener.admobInstance = this;
                AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
                AndroidJavaObject activy = jc.GetStatic<AndroidJavaObject>("currentActivity");

                jadmob.Call("setContext", new object[] { activy, new AdmobListenerProxy(innerlistener) });
			}
		}