Ejemplo n.º 1
0
 public void RegisterHandler(ADHandler handler)
 {
     if (!m_ADHandlerList.Contains(handler))
     {
         handler.RegisterADInterface(this);
         m_ADHandlerList.Add(handler);
     }
 }
Ejemplo n.º 2
0
        public void RegisterADHandler2Interface(ADGroup groupName, ADHandler handler, ADType adType)
        {
            if (!m_ADHandlerList.Contains(handler))
            {
                m_ADHandlerList.Add(handler);
            }

            ADInterface adInterface = null;

            if (m_ADInterfaceGroupDict.TryGetValue(groupName, out adInterface))
            {
                adInterface.RegisterHandler(handler);
            }
            else
            {
                switch (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(groupName);
                    m_ADInterfaceGroupDict.Add(groupName, adInterface);
                    adInterface.RegisterHandler(handler);
                }
                else
                {
                    Log.I("No suit ADInterface.");
                }
            }

            //test
            // foreach (var item in m_ADInterfaceGroupDict.Values)
            // {
            //     foreach (var v in item.m_ADHandlerList)
            //         Log.I("////////////////" + v.m_ADParams.name);
            // }
        }
Ejemplo n.º 3
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);
                }
            }
        }