private void Awake() { if (configuration == null) { throw new Exception("The configuration object cannot be null"); } if (Instance == null) { _nimbusPlatformAPI = _nimbusPlatformAPI ?? new #if UNITY_EDITOR Editor #elif UNITY_ANDROID Android #else IOS #endif (); NimbusEvents = new AdEvents(); Debug.unityLogger.logEnabled = configuration.enableUnityLogs; _nimbusPlatformAPI.InitializeSDK(Debug.unityLogger, configuration); Instance = this; DontDestroyOnLoad(gameObject); } else if (Instance != this) { Destroy(gameObject); } }
private static void eventCallback(AdEvents adEvent, string eventMessage) { // NOTE: On BB10 these events never get called! switch (adEvent) { case AdEvents.Refreshed: singleton.AdStatusText.text = "Refreshed"; break; case AdEvents.Clicked: singleton.AdStatusText.text = "Clicked"; break; case AdEvents.Error: singleton.AdStatusText.text = "Error: " + eventMessage; break; } }
private static void eventCallback(AdEvents adEvent, string eventMessage) { if (singleton.AdStatusText == null) { return; } switch (adEvent) { case AdEvents.Refreshed: singleton.AdStatusText.text = "Refreshed"; break; case AdEvents.Clicked: singleton.AdStatusText.text = "Clicked"; break; case AdEvents.Error: singleton.AdStatusText.text = "Error: " + eventMessage; break; } }
private static void eventCallback(AdEvents adEvent, string eventMessage) { if (singleton.AdStatusText == null) return; switch (adEvent) { case AdEvents.Refreshed: singleton.AdStatusText.text = "Refreshed"; break; case AdEvents.Clicked: singleton.AdStatusText.text = "Clicked"; break; case AdEvents.Error: singleton.AdStatusText.text = "Error: " + eventMessage; break; } }