Example #1
0
 public static void Show(InterstitialType interstitialType)
 {
     PlayAdsSDK.EnsureInstance();
     if (!PlayAdsSDK.ready)
     {
         PlayAdsSDK.Start(ACTION_SHOW, interstitialType);
         return;
     }
     PlayAdsSDK.PlayAdsSDKShow(PlayAdsSDK.GetTypeString(interstitialType));
 }
Example #2
0
 public static void Cache(InterstitialType interstitialType)
 {
     PlayAdsSDK.EnsureInstance();
     if (!PlayAdsSDK.ready)
     {
         PlayAdsSDK.Start(ACTION_CACHE, interstitialType);
         return;
     }
     PlayAdsSDK.PlayAdsSDKCache(PlayAdsSDK.GetTypeString(interstitialType));
 }
Example #3
0
 public static void EnsureInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType(typeof(PlayAdsSDK)) as PlayAdsSDK;
         if (instance == null)
         {
             instance = new GameObject(INSTANCE_NAME).AddComponent <PlayAdsSDK>();
         }
     }
 }
Example #4
0
    public static void Cache(AdType adType)
    {
        PlayAdsSDK.EnsureInstance();
        PlayAdsSDK.currentType = adType;

        if (!PlayAdsSDK.SDKReady)
        {
            PlayAdsSDK.Start(ACTION_CACHE, adType);
            return;
        }

        PlayAdsSDK.PlayAdsSDKCache(PlayAdsSDK.GetTypeString(adType));
    }
Example #5
0
    public static void Show(AdType adType)
    {
        PlayAdsSDK.EnsureInstance();
        PlayAdsSDK.currentType = adType;

        if (!PlayAdsSDK.SDKReady)
        {
            PlayAdsSDK.Start(ACTION_SHOW, adType);
            return;
        }

        PlayAdsSDK.comesFromBackground = false;
        PlayAdsSDK.PlayAdsSDKShow(PlayAdsSDK.GetTypeString(adType), PlayAdsSDK.showLoadingScreen);
    }
Example #6
0
    private void OnApplicationPause(bool paused)
    {
        if (!paused && comesFromBackground)
        {
            bool alreadyInitialized = PlayAdsSDK.SDKReady;
            PlayAdsSDK.SDKReady = false;

            string currentAction = ACTION_NONE;
            if (alreadyInitialized)
            {
                currentAction = ACTION_CACHE;
            }

            PlayAdsSDK.Start(currentAction, currentType);
        }
    }
Example #7
0
    private void SDKStartedCallback(string message)
    {
        PlayAdsSDK.ready        = true;
        PlayAdsSDK.initializing = false;

        if (!string.IsNullOrEmpty(PlayAdsSDK.waitingAction))
        {
            if (ACTION_CACHE.Equals(PlayAdsSDK.waitingAction))
            {
                PlayAdsSDK.Cache(PlayAdsSDK.waitingType);
            }
            else if (ACTION_SHOW.Equals(PlayAdsSDK.waitingAction))
            {
                PlayAdsSDK.Show(PlayAdsSDK.waitingType);
            }
            PlayAdsSDK.waitingAction = null;
        }
    }
Example #8
0
    private static void Start(string action, InterstitialType type)
    {
        PlayAdsSDK.EnsureInstance();
        if (!PlayAdsSDK.initializing)
        {
            PlayAdsSDK.initializing  = true;
            PlayAdsSDK.waitingAction = action;
            PlayAdsSDK.waitingType   = type;

            string appID       = "";
            string secretToken = "";

                        #if UNITY_IPHONE
            appID       = PlayAdsSDKSettings.IOSAppID;
            secretToken = PlayAdsSDKSettings.IOSSecretToken;
                        #elif UNITY_ANDROID
            appID       = PlayAdsSDKSettings.AndroidAppID;
            secretToken = PlayAdsSDKSettings.AndroidSecretToken;
                        #endif

            PlayAdsSDK.PlayAdsSDKStart(appID, secretToken, INSTANCE_NAME);
        }
    }
Example #9
0
 private static void PlayAdsSDKGetVersion()
 {
     PlayAdsSDK.CallAndroidSDK("PlayAdsSDKGetVersion");
 }
 public void OnEnable()
 {
     ManifestModificator.GenerateManifest();
     PlayAdsSDK.EnsureInstance();
 }
Example #11
0
 public static void Show()
 {
     PlayAdsSDK.Show(AdType.Smart);
 }
Example #12
0
 public static void Cache()
 {
     PlayAdsSDK.Cache(InterstitialType.Smart);
 }
Example #13
0
 public static void Show()
 {
     PlayAdsSDK.Show(InterstitialType.Smart);
 }
 private static void ensureInstance()
 {
     if(instance == null)
     {
         instance = FindObjectOfType(typeof(PlayAdsSDK) ) as PlayAdsSDK;
         if(instance == null)
         {
             instance = new GameObject(INSTANCE_NAME).AddComponent<PlayAdsSDK>();
         }
     }
 }
Example #15
0
 private void Awake()
 {
     name = INSTANCE_NAME;
     DontDestroyOnLoad(transform.gameObject);
     PlayAdsSDK.Start(ACTION_NONE, currentType);
 }
Example #16
0
 private static void PlayAdsSDKShow(string typeString, bool showLoadingScreen)
 {
     PlayAdsSDK.CallAndroidSDK("PlayAdsSDKShow", typeString, showLoadingScreen);
 }
Example #17
0
 private static void Start()
 {
     PlayAdsSDK.Start(null, InterstitialType.Smart);
 }
Example #18
0
 /// <summary>
 /// Shows a synchronoys interstitial (blocking the screen)
 /// </summary>
 private void PlayAds_Show()
 {
     PlayAdsSDK.Show();
 }
Example #19
0
 /// <summary>
 /// Shows a synchronoys interstitial (blocking the screen)
 /// </summary>
 public void PlayAds_Show()
 {
     PlayAdsSDK.Show();
 }
Example #20
0
 private static void PlayAdsSDKStart(string appId, string secret, string instanceName)
 {
     PlayAdsSDK.CallAndroidSDK("PlayAdsSDKStart", appId, secret, instanceName);
 }
Example #21
0
 public static bool Ready()
 {
     return(PlayAdsSDK.Ready(PlayAdsSDK.currentType));
 }
Example #22
0
 /// <summary>
 /// Shows an asynchronoys interstitial (blocking the screen only when the interstitial is fully loaded)
 /// </summary>
 private void PlayAds_Cache()
 {
     PlayAdsSDK.Cache();
 }
Example #23
0
 private static void PlayAdsSDKCache(string typeString)
 {
     PlayAdsSDK.CallAndroidSDK("PlayAdsSDKCache", typeString);
 }
Example #24
0
 /// <summary>
 /// Shows an asynchronoys interstitial (blocking the screen only when the interstitial is fully loaded)
 /// </summary>
 public void PlayAds_Cache()
 {
     PlayAdsSDK.Cache();
 }
Example #25
0
 private static void PlayAdsSDKShow(string typeString)
 {
     PlayAdsSDK.CallAndroidSDK("PlayAdsSDKShow", typeString);
 }
 public static void Edit()
 {
     PlayAdsSDK.EnsureInstance();
     Selection.activeObject = Instance;
 }
Example #27
0
 public static void Cache()
 {
     PlayAdsSDK.Cache(AdType.Smart);
 }