コード例 #1
0
    public static void Show(Action <bool> onAdResult)
    {
        Loading.Show();

        #if UNITY_EDITOR
        if (EnableDebugAds)
        {
            TimeUtility.Delay(2, () => { Loading.Hide(); onAdResult.Invoke(true); return; });
        }
        #endif

        if (modulesList.Exists(x => x.rewardedAd.IsLoaded()))
        {
            Debug.Log("[ADS CONTROLLER] Loaded module exists!");
            foreach (AdsModule module in modulesList)
            {
                if (module.rewardedAd.IsLoaded())
                {
                    module.Show(x => TimeUtility.Delay(2, () => {
                        Loading.Hide();
                        onAdResult.Invoke(x);
                    }));
                    break;
                }
            }
        }
        else
        {
            Debug.Log("[ADS CONTROLLER] Loaded module NOT exists!");
            modulesList[modulesList.Count - 1].Show(x => TimeUtility.Delay(2, () => {
                Loading.Hide();
                onAdResult.Invoke(x);
            }));
        }
    }
コード例 #2
0