Exemple #1
0
    void Awake()
    {
        if (TDinstance != null)           // Ensuring no clones
        {
            Destroy(gameObject);
            return;
        }

        //Make the plugin available across all scenes
        TDinstance = this;
        GameObject.DontDestroyOnLoad(gameObject);
        settings = GetComponent <TapdaqSettings>();

        showLogMessages = settings.showLogs;
        testModeEnabled = settings.testMode;

        ios_applicationID     = settings.ios_applicationID;
        ios_clientKey         = settings.ios_clientKey;
        android_applicationID = settings.android_applicationID;
        android_clientKey     = settings.android_clientKey;

        frequencyCap = settings.frequency;
        frequencyCapDurationInDays = settings.duration;

        interstitials = settings.interstitials;

        nativeSquareLarge  = settings.nativeSquareLarge;
        nativeSquareMedium = settings.nativeSquareMedium;
        nativeSquareSmall  = settings.nativeSquareSmall;

        nativeNewsfeedPortraitLarge  = settings.nativeNewsfeedPortraitLarge;
        nativeNewsfeedPortraitMedium = settings.nativeNewsfeedPortraitMedium;
        nativeNewsfeedPortraitSmall  = settings.nativeNewsfeedPortraitSmall;

        nativeNewsfeedLandscapeLarge  = settings.nativeNewsfeedLandscapeLarge;
        nativeNewsfeedLandscapeMedium = settings.nativeNewsfeedLandscapeMedium;
        nativeNewsfeedLandscapeSmall  = settings.nativeNewsfeedLandscapeSmall;

        nativeFullscreenPortraitLarge  = settings.nativeFullscreenPortraitLarge;
        nativeFullscreenPortraitMedium = settings.nativeFullscreenPortraitMedium;
        nativeFullscreenPortraitSmall  = settings.nativeFullscreenPortraitSmall;

        nativeFullscreenLandscapeLarge  = settings.nativeFullscreenLandscapeLarge;
        nativeFullscreenLandscapeMedium = settings.nativeFullscreenLandscapeMedium;
        nativeFullscreenLandscapeSmall  = settings.nativeFullscreenLandscapeSmall;

        nativeStripPortraitLarge  = settings.nativeStripPortraitLarge;
        nativeStripPortraitMedium = settings.nativeStripPortraitMedium;
        nativeStripPortraitSmall  = settings.nativeStripPortraitSmall;

        nativeStripLandscapeLarge  = settings.nativeStripLandscapeLarge;
        nativeStripLandscapeMedium = settings.nativeStripLandscapeMedium;
        nativeStripLandscapeSmall  = settings.nativeStripLandscapeSmall;


        if (showLogMessages)
        {
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Test Mode Active? -- " + testModeEnabled);

#if UNITY_IPHONE
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Application ID -- " + ios_applicationID);
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Client Key -- " + ios_clientKey);
#elif UNITY_ANDROID
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Application ID -- " + android_applicationID);
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Client Key -- " + android_clientKey);
#endif

            logMessage(TDLogSeverity.debug, "TapdaqSDK/Ad Frequency -- " + frequencyCap);
            logMessage(TDLogSeverity.debug, "TapdaqSDK/Ad Duration -- " + frequencyCapDurationInDays);

            if (interstitials)
            {
                logMessage(TDLogSeverity.debug, "Interstitials enabled");
            }

            if (nativeSquareLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Square Large enabled");
            }
            if (nativeSquareMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Square Medium enabled");
            }
            if (nativeSquareSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Square Small enabled");
            }

            if (nativeNewsfeedPortraitLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Portrait Large enabled");
            }
            if (nativeNewsfeedPortraitMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Portrait Medium enabled");
            }
            if (nativeNewsfeedPortraitSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Portrait Small enabled");
            }

            if (nativeNewsfeedLandscapeLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Landscape Large enabled");
            }
            if (nativeNewsfeedLandscapeMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Landscape Medium enabled");
            }
            if (nativeNewsfeedLandscapeSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native News Feed Landscape Small enabled");
            }

            if (nativeFullscreenPortraitLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Portrait Large enabled");
            }
            if (nativeFullscreenPortraitMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Portrait Medium enabled");
            }
            if (nativeFullscreenPortraitSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Portrait Small enabled");
            }

            if (nativeFullscreenLandscapeLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Landscape Large enabled");
            }
            if (nativeFullscreenLandscapeMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Landscape Medium enabled");
            }
            if (nativeFullscreenLandscapeSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Full Screen Landscape Small enabled");
            }

            if (nativeStripPortraitLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Portrait Large enabled");
            }
            if (nativeStripPortraitMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Portrait Medium enabled");
            }
            if (nativeStripPortraitSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Portrait Small enabled");
            }

            if (nativeStripLandscapeLarge)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Landscape Large enabled");
            }
            if (nativeStripLandscapeMedium)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Landscape Medium enabled");
            }
            if (nativeStripLandscapeSmall)
            {
                logMessage(TDLogSeverity.debug, "TapdaqSDK/Native Strip Landscape Small enabled");
            }
        }

//		group = ns_group;
//		interstitialCanvas = ns_interstitialCanvas;
//		interstitialPortraitImage = ns_interstitialPortraitImage;
//		interstitialLandscapeImage = ns_interstitialLandscapeImage;

        //Initialize tapdaq and commence ad caching
        string enabledAdTypes = BuildEnabledAdTypesList();

#if UNITY_IPHONE
        GenerateCallbacks();
        TDinitialize(ios_applicationID, ios_clientKey, frequencyCap, frequencyCapDurationInDays, enabledAdTypes);
#elif UNITY_ANDROID
        TDinitialize(android_applicationID, android_clientKey, frequencyCap, frequencyCapDurationInDays, enabledAdTypes);
#endif

        externalNative = new TapdaqNativeAd();
    }
Exemple #2
0
    void Awake()
    {
        if (TDinstance != null)           // Ensuring no clones
        {
            Destroy(gameObject);
            return;
        }
        //Make the plugin available across all scenes
        TDinstance = this;
        GameObject.DontDestroyOnLoad(gameObject);
        settings   = GetComponent <TapdaqSettings>();
        view       = GetComponent <TapdaqView>();
        closeImage = Resources.Load("tdCircle") as Texture;


        //Apply All Settings
        showLogMessages = settings.showLogs;
        _TEST_MODE_     = settings.testMode;

        ios_applicationID     = settings.ios_applicationID;
        ios_clientKey         = settings.ios_clientKey;
        android_applicationID = settings.android_applicationID;
        android_clientKey     = settings.android_clientKey;

        frequency = settings.frequency;
        duration  = settings.duration;

        interstitials = settings.interstitials;
        //interstitialPortrait = settings.interstitialPortrait;
        //interstitialLandscape = settings.interstitialLandscape;


        nativeSquareLarge  = settings.nativeSquareLarge;
        nativeSquareMedium = settings.nativeSquareMedium;
        nativeSquareSmall  = settings.nativeSquareSmall;

        nativeNewsfeedPortraitLarge  = settings.nativeNewsfeedPortraitLarge;
        nativeNewsfeedPortraitMedium = settings.nativeNewsfeedPortraitMedium;
        nativeNewsfeedPortraitSmall  = settings.nativeNewsfeedPortraitSmall;

        nativeNewsfeedLandscapeLarge  = settings.nativeNewsfeedLandscapeLarge;
        nativeNewsfeedLandscapeMedium = settings.nativeNewsfeedLandscapeMedium;
        nativeNewsfeedLandscapeSmall  = settings.nativeNewsfeedLandscapeSmall;

        nativeFullscreenPortraitLarge  = settings.nativeFullscreenPortraitLarge;
        nativeFullscreenPortraitMedium = settings.nativeFullscreenPortraitMedium;
        nativeFullscreenPortraitSmall  = settings.nativeFullscreenPortraitSmall;

        nativeFullscreenLandscapeLarge  = settings.nativeFullscreenLandscapeLarge;
        nativeFullscreenLandscapeMedium = settings.nativeFullscreenLandscapeMedium;
        nativeFullscreenLandscapeSmall  = settings.nativeFullscreenLandscapeSmall;

        nativeStripPortraitLarge  = settings.nativeStripPortraitLarge;
        nativeStripPortraitMedium = settings.nativeStripPortraitMedium;
        nativeStripPortraitSmall  = settings.nativeStripPortraitSmall;

        nativeStripLandscapeLarge  = settings.nativeStripLandscapeLarge;
        nativeStripLandscapeMedium = settings.nativeStripLandscapeMedium;
        nativeStripLandscapeSmall  = settings.nativeStripLandscapeSmall;


        if (showLogMessages)
        {
            Debug.Log("TapdaqSDK/Test Mode Active? -- " + _TEST_MODE_);
#if UNITY_IPHONE
            Debug.Log("TapdaqSDK/Application ID -- " + ios_applicationID);
            Debug.Log("TapdaqSDK/Client Key -- " + ios_clientKey);
#elif UNITY_ANDROID
            Debug.Log("TapdaqSDK/Application ID -- " + android_applicationID);
            Debug.Log("TapdaqSDK/Client Key -- " + android_clientKey);
#endif

            Debug.Log("TapdaqSDK/Ad Frequency -- " + frequency);
            Debug.Log("TapdaqSDK/Ad Duration -- " + duration);

            //if(interstitialPortrait)Debug.Log("TapdaqSDK/Portrait Interstitials enabled");
            //if(interstitialLandscape)Debug.Log("TapdaqSDK/Landscape Interstitials enabled");

            if (interstitials)
            {
                if (Screen.width >= Screen.height)
                {
                    Debug.Log("TapdaqSDK/Landscape Interstitials enabled");
                }
                else
                {
                    Debug.Log("TapdaqSDK/Portrait Interstitials enabled");
                }
            }

            if (nativeSquareLarge)
            {
                Debug.Log("TapdaqSDK/Native Square Large enabled");
            }
            if (nativeSquareMedium)
            {
                Debug.Log("TapdaqSDK/Native Square Medium enabled");
            }
            if (nativeSquareSmall)
            {
                Debug.Log("TapdaqSDK/Native Square Small enabled");
            }

            if (nativeNewsfeedPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Large enabled");
            }
            if (nativeNewsfeedPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Medium enabled");
            }
            if (nativeNewsfeedPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native News Feed Portrait Small enabled");
            }

            if (nativeNewsfeedLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Large enabled");
            }
            if (nativeNewsfeedLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Medium enabled");
            }
            if (nativeNewsfeedLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native News Feed Landscape Small enabled");
            }

            if (nativeFullscreenPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Large enabled");
            }
            if (nativeFullscreenPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Medium enabled");
            }
            if (nativeFullscreenPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Portrait Small enabled");
            }

            if (nativeFullscreenLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Large enabled");
            }
            if (nativeFullscreenLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Medium enabled");
            }
            if (nativeFullscreenLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native Full Screen Landscape Small enabled");
            }

            if (nativeStripPortraitLarge)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Large enabled");
            }
            if (nativeStripPortraitMedium)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Medium enabled");
            }
            if (nativeStripPortraitSmall)
            {
                Debug.Log("TapdaqSDK/Native Strip Portrait Small enabled");
            }

            if (nativeStripLandscapeLarge)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Large enabled");
            }
            if (nativeStripLandscapeMedium)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Medium enabled");
            }
            if (nativeStripLandscapeSmall)
            {
                Debug.Log("TapdaqSDK/Native Strip Landscape Small enabled");
            }
        }

//		group = ns_group;
//		interstitialCanvas = ns_interstitialCanvas;
//		interstitialPortraitImage = ns_interstitialPortraitImage;
//		interstitialLandscapeImage = ns_interstitialLandscapeImage;

        //Initialize tapdaq and commence ad caching
        BuildEnabledAdTypesList();
#if UNITY_IPHONE
        GenerateCallbacks();
        TDinitialize(ios_applicationID, ios_clientKey, frequency, duration, flatList);
#elif UNITY_ANDROID
        TDinitialize(android_applicationID, android_clientKey, frequency, duration, flatList);
#endif

        externalInterstitial = new TapdaqInterstitialAd();
        externalNative       = new TapdaqNativeAd();
    }
Exemple #3
0
 void OnEnable()
 {
     _tdSettings = (TapdaqSettings)target;
 }