private static void ensureInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType(typeof(Dreamobi)) as Dreamobi;
         if (instance == null)
         {
             instance = new GameObject("Dreamobi").AddComponent <Dreamobi>();
         }
     }
 }
 /// <summary>
 /// This is the default logic to be performed on button pressed
 /// </summary>
 public override void PerformButtonPressLogic()
 {
     Dreamobi.OnAdAttemptFinished = OnAdAttemptFinished;
     Dreamobi.OnVideoStarted      = OnVideoStarted;
     if (Dreamobi.IsInstantVideoAvailable())
     {
         Debug.Log(this.gameObject.name + " triggered playing a video ad.");
         Dreamobi.ShowVideoAd();
     }
     else
     {
         string text = this.gameObject.name + " tried to play an ad, but video is not available yet.";
         Debug.Log(text);
         globalStatusText.text = text;
     }
 }
    //---------------------------------------------------------------------------

    // Use this for initialization
    public override void Start()
    {
        base.Start();
        Dreamobi.Configure(token, bundleId, unitName);
    }
Example #4
0
 /// <summary>
 /// This is the default logic to be performed on button pressed
 /// </summary>
 public override void PerformButtonPressLogic()
 {
     Dreamobi.OnAdAttemptFinished = OnAdAttemptFinished;
     Dreamobi.OnVideoStarted      = OnVideoStarted;
     Dreamobi.ShowInterstitialWall();
 }