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