コード例 #1
0
        public void Load(string placementId, IUnityAdsLoadListener loadListener)
        {
            // If placementId is null, use explicit defaultPlacement to match native behaviour
            if (m_Initialized && placementId == null)
            {
                placementId = m_Configuration.defaultPlacement;
            }

            if (!m_Initialized)
            {
                m_QueuedLoads?.Enqueue(placementId);
                return;
            }

            m_Platform.UnityLifecycleManager.Post(() => {
                if (m_PlacementMap.ContainsKey(placementId))
                {
                    m_PlacementMap[placementId] = true;
                    m_Platform.UnityAdsReady(placementId);
                    loadListener?.OnUnityAdsAdLoaded(placementId);
                }
                else
                {
                    string errorMessage = "Placement " + placementId + " does not exist for gameId: " + m_GameId;
                    m_Platform.UnityAdsDidError(errorMessage);
                    loadListener?.OnUnityAdsFailedToLoad(placementId, UnityAdsLoadError.INVALID_ARGUMENT, errorMessage);
                }
            });
        }
コード例 #2
0
 public void onUnityAdsAdLoaded(string placementId)
 {
     m_Platform?.UnityAdsReady(placementId);
     m_ManagedListener?.OnUnityAdsAdLoaded(placementId);
 }
コード例 #3
0
 private void OnLoadSuccess(string placementId)
 {
     m_UnityAdsInternalListener?.OnUnityAdsAdLoaded(placementId);
     m_UserListener?.OnUnityAdsAdLoaded(placementId);
 }