Exemplo n.º 1
0
 void Awake()
 {
     Time.timeScale = 1;
     try
     {
         revMob = RevMob.Start (REVMOB_APP_IDS,"GameObject");
         ban = revMob.CreateBanner();//(0,0,350,50,null,null);
     //revMob.CreateBanner (0,0,350,50,null,null);
         tried  = true;
     }
     catch
     {
     }
     //revMob.SetTimeoutInSeconds (5);
     Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
     Debug.Log("HI "+tried.ToString () );
 }
Exemplo n.º 2
0
    void PreLoadBanner()
    {
        i++;
        if( GUI.Button(new Rect(X_POSITION_REFERENCE, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Load Banner") ) {
          		#if UNITY_ANDROID || UNITY_IPHONE
        // if (loadedBanner == null) {
          				loadedBanner = revmob.CreateBanner();
        // }
          		#endif
          			return;
        }

        if (loadedBanner != null)
        {
          		if( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, (i+1) * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Show Loaded Banner") ) {
          		#if UNITY_ANDROID || UNITY_IPHONE
              loadedBanner.Show();
          		#endif
          			return;
          		}
        }

        if (loadedBanner != null)
        {
          if( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, (i+2) * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Hide Loaded Banner") ) {
          		#if UNITY_ANDROID || UNITY_IPHONE
              loadedBanner.Hide();
          		#endif
          			return;
          		}
        }

        if (loadedBanner != null)
        {
          if( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, (i+3) * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Release Loaded Banner") ) {
        #if UNITY_ANDROID || UNITY_IPHONE
                loadedBanner.Release();
        loadedBanner = null;
        #endif
            return;
          		}
        }
    }
Exemplo n.º 3
0
    void CreateBannerButtons()
    {
        i++;
        if( GUI.Button(new Rect(X_POSITION_REFERENCE, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Show Banner") ) {
        #if UNITY_ANDROID || UNITY_IPHONE
            if (banner == null) {
                banner = revmob.CreateBanner();
            }
            banner.Show();
        #endif
            return;
        }
        i++;
        if ( GUI.Button(new Rect(X_POSITION_REFERENCE, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Custom Banner") ) {
        #if UNITY_ANDROID
            banner = revmob.CreateBanner(RevMob.Position.TOP, 0, 0, Screen.width, 55);
            banner.Show();
        #elif UNITY_IPHONE
            banner = revmob.CreateBanner(10, 20, 200, 40, null, null);
            banner.Show();
        #endif
            return;
        }

        if (banner != null)
        {
            if ( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, i * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Hide Banner") ) {
            #if UNITY_ANDROID || UNITY_IPHONE
                banner.Hide();
            #endif
                return;
            }
        }

        if (banner != null)
        {
            if ( GUI.Button(new Rect(X_POSITION_REFERENCE + BUTTON_WIDTH + PADDING, (i+1) * Y_POSITION_REFERENCE, BUTTON_WIDTH, BUTTON_HEIGHT), "Deactivate Banner") ) {
            #if UNITY_ANDROID || UNITY_IPHONE
                banner.Release();
                banner = null;
            #endif
                return;
            }
        }
    }
Exemplo n.º 4
0
	public static void HideBanner()
	{
		#if UNITY_ANDROID || UNITY_IPHONE
		if(bannerShowed)
		{
			banner.Hide();
			banner.Release();
			banner = null;
			bannerShowed = false;
		}
		#endif
	}
Exemplo n.º 5
0
	public static void ShowBanner(RevMob.Position position)
	{
		#if UNITY_ANDROID || UNITY_IPHONE
		if(!bannerShowed)
		{
			banner = revmob.CreateBanner (position);
			banner.Show ();
			bannerShowed = true;
		}
		#endif
	}
Exemplo n.º 6
0
	public override void fetchBanner(AdvertisementManager.Positions pos)
	{
		try
		{
			base.fetchBanner(pos);
			
			if (Info.IsEditor() || (firstTime && !Setup()))
				return;
			
			#if UNITY_IPHONE
				ScreenOrientation or;
				
				if (pos == AdvertisementManager.Positions.BOTTOM) or = Screen.orientation;
				else
				{
					switch (Screen.orientation)
					{
						case ScreenOrientation.Portrait: or = ScreenOrientation.PortraitUpsideDown; break;
						case ScreenOrientation.PortraitUpsideDown: or = ScreenOrientation.Portrait; break;
						case ScreenOrientation.LandscapeLeft: or = ScreenOrientation.LandscapeRight; break;
						case ScreenOrientation.LandscapeRight: or = ScreenOrientation.LandscapeLeft; break;
						default: or = ScreenOrientation.PortraitUpsideDown; break;
					}
				}
				
				ScreenOrientation[] ors = new ScreenOrientation[1] {or};
				
				banner = instance.CreateBanner(null, ors);
			#endif
		}
		catch
		{
			Error(API, ERROR_LOADING_BANNER);
		}
	}