Esempio n. 1
0
        public override void Execute()
        {
            logger.Log("ShowSessionStartCommand: Attempting to show start if available");

            // According to new guidelines - by default we won't show session start when no ads is bought
            bool disableSessionStartOnNoAds = generalParamtersConfigModel.GetBool("DisableSessionStartOnNoAds", true);
            bool noAdsBought = !settingsStateModel.ShowingAds();

            bool skipShowingSessionStart = disableSessionStartOnNoAds && noAdsBought;

            if (skipShowingSessionStart)
            {
                logger.Log("ShowSessionStartCommand: No ads bought - skip showing session start");
                return;
            }
            else
            {
                logger.Log(Tag, "No ads bought - skip showing session start");
            }

            bool showSessionStartOnFirstSession = generalParamtersConfigModel.GetBool("ShowSessionStartOnFirstSession", true);

            logger.Log(Tag, "ShowSessionStartOnFirstSession :" + showSessionStartOnFirstSession);

            int launchCount = TTPlayerPrefs.GetValue("TimesLaunched", 1);

            logger.Log(Tag, "App Launch count : " + launchCount);

            if (!showSessionStartOnFirstSession && launchCount <= 1)
            {
                logger.Log("ShowSessionStartCommand: skipping show in first game session");
                return;
            }

            if (Application.isEditor && !GsdkSettingsData.Instance.IsShowingSessionStartInEditor)
            {
                logger.Log("ShowSessionStartCommand: skipping show in Unity Editor");
                return;
            }

            Retain();

            popupHandle = locationManager.Get(ApplicationLocation.AppLoaded);

            popupHandle.Closed.AddListener(OnLocationClosed);
            float sessionStartTimeOut = generalParamtersConfigModel.GetFloat(SessionStartTimeOut, 10.0f);

            popupHandle.Open(OnLocationResult, sessionStartTimeOut);
        }
        public override void Execute()
        {
            CoreLogger.LogDebug("ShowAppShelfCommand : Attempting to show app shelf");

            if (locationManager.IsReady(ApplicationLocation.MoreApps))
            {
                Retain();
                popupHandle = locationManager.Get(ApplicationLocation.MoreApps);
                popupHandle.Closed.AddListener(HandleCloseResult);
                popupHandle.Open(HandleShowResult);
            }
            else
            {
                Debug.LogWarning("ShowAppShelfCommand - Will not show app shelf, location not ready");
            }
        }
        public override void Execute()
        {
            logger.Log(Tag, "Attempting to show Interstitial - showingAds: " + settingsStateModel.ShowingAds());

            var targetLocation = location ?? ApplicationLocation.SceneTransitions;

            if (!settingsStateModel.ShowingAds())
            {
                logger.Log(Tag, "will not show ad since noAds was bought");
                var result = new LocationResult {
                    location = targetLocation,
                    success  = false
                };
                interstitialDoneSignal.Dispatch(result);
            }

            logger.Log(Tag, "Attempting to show Interstitial");

            Retain();
            popupHandle = locationManager.Get(targetLocation);
            popupHandle.Closed.AddListener(OnInterstitialCloseResult);
            popupHandle.Open(OnInterstitialShowResult);
        }