public static void Show(InterstitialType interstitialType) { PlayAdsSDK.EnsureInstance(); if (!PlayAdsSDK.ready) { PlayAdsSDK.Start(ACTION_SHOW, interstitialType); return; } PlayAdsSDK.PlayAdsSDKShow(PlayAdsSDK.GetTypeString(interstitialType)); }
public static void Cache(InterstitialType interstitialType) { PlayAdsSDK.EnsureInstance(); if (!PlayAdsSDK.ready) { PlayAdsSDK.Start(ACTION_CACHE, interstitialType); return; } PlayAdsSDK.PlayAdsSDKCache(PlayAdsSDK.GetTypeString(interstitialType)); }
public static void EnsureInstance() { if (instance == null) { instance = FindObjectOfType(typeof(PlayAdsSDK)) as PlayAdsSDK; if (instance == null) { instance = new GameObject(INSTANCE_NAME).AddComponent <PlayAdsSDK>(); } } }
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)); }
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); }
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); } }
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; } }
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); } }
private static void PlayAdsSDKGetVersion() { PlayAdsSDK.CallAndroidSDK("PlayAdsSDKGetVersion"); }
public void OnEnable() { ManifestModificator.GenerateManifest(); PlayAdsSDK.EnsureInstance(); }
public static void Show() { PlayAdsSDK.Show(AdType.Smart); }
public static void Cache() { PlayAdsSDK.Cache(InterstitialType.Smart); }
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>(); } } }
private void Awake() { name = INSTANCE_NAME; DontDestroyOnLoad(transform.gameObject); PlayAdsSDK.Start(ACTION_NONE, currentType); }
private static void PlayAdsSDKShow(string typeString, bool showLoadingScreen) { PlayAdsSDK.CallAndroidSDK("PlayAdsSDKShow", typeString, showLoadingScreen); }
private static void Start() { PlayAdsSDK.Start(null, InterstitialType.Smart); }
/// <summary> /// Shows a synchronoys interstitial (blocking the screen) /// </summary> private void PlayAds_Show() { PlayAdsSDK.Show(); }
/// <summary> /// Shows a synchronoys interstitial (blocking the screen) /// </summary> public void PlayAds_Show() { PlayAdsSDK.Show(); }
private static void PlayAdsSDKStart(string appId, string secret, string instanceName) { PlayAdsSDK.CallAndroidSDK("PlayAdsSDKStart", appId, secret, instanceName); }
public static bool Ready() { return(PlayAdsSDK.Ready(PlayAdsSDK.currentType)); }
/// <summary> /// Shows an asynchronoys interstitial (blocking the screen only when the interstitial is fully loaded) /// </summary> private void PlayAds_Cache() { PlayAdsSDK.Cache(); }
private static void PlayAdsSDKCache(string typeString) { PlayAdsSDK.CallAndroidSDK("PlayAdsSDKCache", typeString); }
/// <summary> /// Shows an asynchronoys interstitial (blocking the screen only when the interstitial is fully loaded) /// </summary> public void PlayAds_Cache() { PlayAdsSDK.Cache(); }
private static void PlayAdsSDKShow(string typeString) { PlayAdsSDK.CallAndroidSDK("PlayAdsSDKShow", typeString); }
public static void Edit() { PlayAdsSDK.EnsureInstance(); Selection.activeObject = Instance; }
public static void Cache() { PlayAdsSDK.Cache(AdType.Smart); }