Exemplo n.º 1
0
 private void Start()
 {
     membershipController = GetComponentInParent <MembershipController>();
     LegalPriceText.text  = membershipController.GetLegalText();
     membershipController.OnProductsReady += updateLegalText;
     membershipController.GetProduct(hasTrialAvailable: true);
 }
Exemplo n.º 2
0
    private void Start()
    {
        membershipController = GetComponentInParent <MembershipController>();
        membershipController.OnPurchaseRetried += onPurchaseRetried;
        backgroundButtons  = GetComponentInParent <BackgroundButtonsController>();
        showCarrierBilling = membershipController.IsCarrierBillingAvailable();
        string message = showCarrierBilling ? "with_carrier_billing_info" : "regular";

        Service.Get <ICPSwrveService>().Funnel(Service.Get <MembershipService>().MembershipFunnelName, "03", "membership_terms", message);
        PenguinName.text = Service.Get <SessionManager>().LocalUser.RegistrationProfile.DisplayName;
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
        DataEntityHandle       localPlayerHandle      = cPDataEntityCollection.LocalPlayerHandle;

        if (!(SceneManager.GetActiveScene().name == "Boot"))
        {
            avatarRenderer = GetComponentInChildren <AvatarRenderTextureComponent>();
            AvatarAnimationFrame avatarFrame = new AvatarAnimationFrame("Base Layer.Interactions.PassPortPoses_CelebrateAnimation", 0f);
            if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out AvatarDetailsData component))
            {
                avatarRenderer.RenderAvatar(component, avatarFrame);
            }
            else
            {
                avatarRenderer.RenderAvatar(new DCustomEquipment[0], avatarFrame);
            }
        }
        bool           hasTrialAvailable = true;
        MembershipData component3        = default(MembershipData);

        if (cPDataEntityCollection.TryGetComponent(localPlayerHandle, out ProfileData component2) && cPDataEntityCollection.TryGetComponent(localPlayerHandle, out component3))
        {
            if (component2.IsFirstTimePlayer || SceneManager.GetActiveScene().name != Service.Get <GameStateController>().SceneConfig.HomeSceneName)
            {
                ChangePenguinContainer.SetActive(value: false);
            }
            else
            {
                ChangePenguinContainer.SetActive(value: true);
            }
            hasTrialAvailable = component3.MembershipTrialAvailable;
        }
        membershipController.OnProductsReady += onProductsReady;
        membershipController.GetProduct(hasTrialAvailable);
        if (MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel == NativeAccessibilityLevel.VOICE)
        {
            string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("Accessibility.Popup.Title.MembershipTerms");
            MonoSingleton <NativeAccessibilityManager> .Instance.Native.Speak(tokenTranslation);
        }
    }