Пример #1
0
 private static void OnPostProcessScene()
 {
     if (File.Exists(ModePath))
     {
         try {
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             ConfigureProject(config.androidStore);
         } catch (Exception e) {
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, use menu (e.g. " + GooglePlayMenuItem + ") and check file: " + ModePath);
             Debug.LogError(e);
         }
     }
 }
 private static void OnPostProcessScene()
 {
     if (File.Exists(ModePath))
     {
         try {
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             ConfigureProject(config.androidStore);
         } catch (Exception e) {
             #if ENABLE_EDITOR_GAME_SERVICES
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, check file: " + ModePath);
             #else
             Debug.LogError("Unity IAP unable to strip undesired Android stores from build, use menu (e.g. "
                            + SwitchStoreMenuItem + ") and check file: " + ModePath);
             #endif
             Debug.LogError(e);
         }
     }
 }
 // Create or read BillingMode.json at Project Editor load
 static UnityPurchasingEditor()
 {
     EditorApplication.delayCall += () =>
     {
         if (File.Exists(ModePath))
         {
             var oldAppStore = GetAppStoreSafe();
             config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
             if (oldAppStore != config.androidStore)
             {
                 OnAndroidTargetChange?.Invoke(config.androidStore);
             }
         }
         else
         {
             CreateDefaultBillingModeFile();
         }
     };
 }
Пример #4
0
        // Create or read BillingMode.json at Project Editor load
        static UnityPurchasingEditor()
        {
            EditorApplication.delayCall += () => {
                if (File.Exists(ModePath))
                {
                    config = StoreConfiguration.Deserialize(File.ReadAllText(ModePath));
                    RefreshCheckmarks();
                }
                else
                {
                    // New project. Create default BillingMode.json.
                    TargetAndroidStore(AppStore.GooglePlay);
                }
            };

            if (!hasRegisteredForPlaymodeStateChanges)
            {
#if UNITY_2017_2_OR_NEWER
                EditorApplication.playModeStateChanged += RefreshCheckmarksOnPlaymodeState;
#else
                EditorApplication.playmodeStateChanged += RefreshCheckmarks;
#endif
            }
        }