private void showGate(IContentInterruption gate)
 {
     openContentInterruption = gate;
     gate.OnReturn          += HandleOnGateFailed;
     gate.OnContinue        += onGatePassed;
     gate.Show(parentTransform);
 }
Example #2
0
 private void onConfirmClicked()
 {
     ToggleInteraction(isInteractable: false);
     gate             = new AgeGate();
     gate.OnReturn   += onGateFailed;
     gate.OnContinue += onGatePassed;
     gate.Show(base.transform);
     Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().MembershipFunnelName, "02", "agegate_triggered");
 }
 private void initializeGate(IContentInterruption gate)
 {
     if (gate != null)
     {
         blockLinks = false;
         showGate(gate);
     }
     else
     {
         blockLinks = true;
         loadWebPage();
     }
 }
 public void Show(string URLToken, IContentInterruption gate, GameObject webViewerPanel, Button ScrollUpButton, Button ScrollDownButton, bool isDownsampled, bool AllowPopups = false, bool openPopupInNewBrowser = false, float zoomLevel = 0f, float newBrowserZoomLevel = 0f)
 {
     if (ScrollUpButton != null)
     {
         scrollUp = ScrollUpButton;
         scrollUp.gameObject.SetActive(value: false);
     }
     if (ScrollDownButton != null)
     {
         scrollDown = ScrollDownButton;
         scrollDown.gameObject.SetActive(value: false);
     }
     parentTransform = webViewerPanel.transform;
     webViewComponentController.Url = getLocalizedURL(URLToken);
     webViewComponentController.SetUp(webViewerPanel, isDownsampled, AllowPopups, openPopupInNewBrowser, zoomLevel, newBrowserZoomLevel);
     initializeGate(gate);
 }
 private void onConfirmClicked()
 {
     ToggleInteraction(isInteractable: false);
     if (!Service.Get <SessionManager>().HasSession)
     {
         membershipService.LoginViaMembership = true;
         membershipController.MembershipLoginNeeded();
         Service.Get <ICPSwrveService>().NavigationAction("membership_buttons.OfferConfirm", "login_needed");
         return;
     }
     if (LogMembershipView)
     {
         string currentMembershipStatus = Service.Get <MembershipService>().GetCurrentMembershipStatus();
         Service.Get <ICPSwrveService>().Action("game.free_trial", MembershipViewTrigger, currentMembershipStatus, SceneManager.GetActiveScene().name);
     }
     gate             = new ParentGate();
     gate.OnReturn   += onGateFailed;
     gate.OnContinue += onGatePassed;
     gate.Show(base.transform);
     Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().MembershipFunnelName, "02", "agegate_triggered");
     Service.Get <ICPSwrveService>().NavigationAction("membership_buttons.OfferConfirm", "trigger_agegate");
     base.gameObject.SetActive(value: false);
 }
        private IEnumerator loadPopupFromPrefab(PrefabContentKey popupKey, string URLToken, IContentInterruption gate, string popupTitleToken, bool allowPopups = false, bool openPopupInNewBrowser = false, float zoomLevel = 0f, float newBrowserZoomLevel = 0f)
        {
            AssetRequest <GameObject> assetRequest = Content.LoadAsync(popupKey);

            yield return(assetRequest);

            instantiatedPrefab = UnityEngine.Object.Instantiate(assetRequest.Asset);
            WebViewPrefabController webViewPrefabController = instantiatedPrefab.GetComponent <WebViewPrefabController>();

            title = webViewPrefabController.TitleText;
            Button scrollUpButton   = webViewPrefabController.ScrollUp;
            Button scrollDownButton = webViewPrefabController.ScrollDown;

            backButton        = webViewPrefabController.CloseButton;
            webViewPopupPanel = webViewPrefabController.WebViewerPanel;
            loadingPanel      = webViewPrefabController.LoadingPanel;
            if (title != null && backButton != null && webViewPopupPanel != null)
            {
                title.text = getLocalizedURL(popupTitleToken);
                backButton.onClick.AddListener(handlePopupClose);
                if ((bool)GameObject.Find("TopCanvas"))
                {
                    Service.Get <EventDispatcher>().DispatchEvent(new PopupEvents.ShowTopPopup(instantiatedPrefab));
                }
                else
                {
                    Service.Get <EventDispatcher>().DispatchEvent(new PopupEvents.ShowPopup(instantiatedPrefab));
                }
                yield return(new WaitForEndOfFrame());

                if (loadingPanel != null)
                {
                    loadingPanel.SetActive(value: true);
                }
                Show(URLToken, gate, webViewPopupPanel, scrollUpButton, scrollDownButton, isDownsampled: false, allowPopups, openPopupInNewBrowser, zoomLevel, newBrowserZoomLevel);
            }
            else
            {
                Log.LogError(this, "Missing key elements from prefab for " + popupKey);
                this.OnFailed.InvokeSafe();
            }
            yield return(null);
        }
 public void initializePopup(PrefabContentKey popupKey, string URLToken, IContentInterruption gate, string popupTitleToken, bool allowPopups = false, bool openPopupInNewBrowser = false, float zoomLevel = 0f, float newBrowserZoomLevel = 0f)
 {
     CoroutineRunner.Start(loadPopupFromPrefab(popupKey, URLToken, gate, popupTitleToken, allowPopups, openPopupInNewBrowser, zoomLevel, newBrowserZoomLevel), this, "loadPopupFromPrefab");
 }
 public void Show(string URLToken, IContentInterruption gate, string popupTitleToken, PrefabContentKey webViewerPrefabKey, bool AllowPopups = false, bool openPopupInNewBrowser = false, float zoomLevel = 0f, float newBrowserZoomLevel = 0f)
 {
     initializePopup(webViewerPrefabKey, URLToken, gate, popupTitleToken, AllowPopups, openPopupInNewBrowser, zoomLevel, newBrowserZoomLevel);
 }