Ejemplo n.º 1
0
        static PurchasingImporter()
        {
#if !UNITY_UNIFIED_IAP && !NON_COMPILED_UPM
            var importer = AssetImporter.GetAtPath(AssetDatabase.GUIDToAssetPath("b5f4343795a0e4626ac1fe4a9e6fce59" /* UnityEngine.Purchasing.dll */)) as PluginImporter;
            if (importer)
            {
                bool compatible = BuildPipeline.IsFeatureSupported("ENABLE_CLOUD_SERVICES_PURCHASING", EditorUserBuildSettings.activeBuildTarget);
                importer.SetCompatibleWithEditor(compatible);
                importer.SetCompatibleWithAnyPlatform(compatible);
#else
            {
#endif

                PurchasingSettings.ApplyEnableSettings(EditorUserBuildSettings.activeBuildTarget);

#if !UNITY_UNIFIED_IAP
                BuildDefines.getScriptCompilationDefinesDelegates += (target, defines) =>
                {
                    if (PurchasingSettings.enabledForPlatform)
                    {
                        defines.Add("UNITY_PURCHASING");
                    }
                };
#endif
            }
        }
    }
Ejemplo n.º 2
0
 public override void EnableService(bool enabled)
 {
     if (PurchasingSettings.enabled != enabled)
     {
         PurchasingSettings.SetEnabledServiceWindow(enabled);
         EditorAnalytics.SendEventServiceInfo(new PurchasingAccess.PurchasingServiceState
         {
             iap = enabled
         });
     }
 }
 public CompleteOrderService(
     ApplicationDbContext context,
     IEmailService emailService,
     ICreatePurchasingDocumentService createPurchasingDocumentService,
     PurchasingSettings purchasingSettings)
 {
     this.context      = context ?? throw new ArgumentNullException(nameof(context));
     this.emailService = emailService ?? throw new ArgumentNullException(nameof(emailService));
     this.createPurchasingDocumentService = createPurchasingDocumentService ?? throw new ArgumentNullException(nameof(createPurchasingDocumentService));
     this.purchasingSettings = purchasingSettings ?? throw new ArgumentNullException(nameof(purchasingSettings));
 }
        protected override void InternalEnableService(bool enable, bool shouldUpdateApiFlag)
        {
            if (PurchasingSettings.enabled != enable)
            {
                PurchasingSettings.SetEnabledServiceWindow(enable);
                EditorAnalytics.SendEventServiceInfo(new PurchasingServiceState()
                {
                    iap = enable
                });
                if (enable && !AnalyticsService.instance.IsServiceEnabled())
                {
                    AnalyticsService.instance.EnableService(true, shouldUpdateApiFlag);
                }
            }

            base.InternalEnableService(enable, shouldUpdateApiFlag);
        }
Ejemplo n.º 5
0
 static PurchasingImporter()
 {
     PurchasingSettings.ApplyEnableSettings(EditorUserBuildSettings.activeBuildTarget);
 }