Beispiel #1
0
        private void RegisterADInterface(SDKADAdapterConfig config)
        {
            for (int i = 0; i < config.adParamsList.Count; i++)
            {
                ADInterface adInterface = null;
                if (m_ADInterfaceGroupDict.TryGetValue(config.adParamsList[i].adInterfaceGroup, out adInterface))
                {
                    continue;
                }
                switch (config.adParamsList[i].adType)
                {
                case ADType.Banner:
                    adInterface = new ADBannerInterface();
                    break;

                case ADType.Interstitial:
                    adInterface = new ADInterstitialInterface();
                    break;

                case ADType.Reward:
                    adInterface = new ADInterstitialInterface();
                    break;

                default:
                    break;
                }
                if (adInterface != null)
                {
                    adInterface.Init(config.adParamsList[i].adInterfaceGroup);
                    m_ADInterfaceGroupDict.Add(config.adParamsList[i].adInterfaceGroup, adInterface);
                }
            }
        }
Beispiel #2
0
        public void CreateAll()
        {
            SDKADAdapterConfig adapterConfig = m_AdapterConfig as SDKADAdapterConfig;

            for (int i = 0; i < adapterConfig.adParamsList.Count; i++)
            {
                ADHandler handler = null;
                switch (adapterConfig.adParamsList[i].adType)
                {
                case ADType.Banner:
                    handler = CreateBannerAD();
                    break;

                case ADType.Interstitial:
                    handler = CreateInterstitialAD();
                    break;

                case ADType.Reward:
                    handler = CreateRewardVideoAD();
                    break;

                case ADType.FullScreen:
                    handler = CreateFullScreenAD();
                    break;

                case ADType.Native:
                    handler = CreateNativeAD();
                    break;
                }
                if (handler != null)
                {
                    handler.Init(adapterConfig.adParamsList[i]);
                    ADMgr.S.RegisterADHandler2Interface(adapterConfig.adParamsList[i].adInterfaceGroup, handler, adapterConfig.adParamsList[i].adType);
                }
            }
        }