예제 #1
0
        void IPreprocessBuild.OnPreprocessBuild(BuildTarget target, string path)
        {
            var storeSettings = EditorBuildConfig.ActiveConfig.GetSettings <AndroidStoreSettings>();

            if (storeSettings != null)
            {
                UnityPurchasingEditor.TargetAndroidStore(AndroidStore.AmazonAppStore);
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="InvalidOperationException"></exception>
        public static void ApplyBuildConfig(IBuildConfig config)
        {
            ApplyAppConfig(config);
            ApplyVersionConfig(config);

#if UNITY_PURCHASING
            if (config.Store != AppStore.NotSpecified)
            {
                UnityPurchasingEditor.TargetAndroidStore(config.Store);
            }
#endif

            PlayerSettings.SetScriptingDefineSymbolsForGroup(GetActiveBuildTargetGroup(), string.Join(";", config.Defines));
        }
예제 #3
0
    public void OnPreprocessBuild(BuildReport report)
    {
#if AMAZON
        UnityPurchasingEditor.TargetAndroidStore(AppStore.AmazonAppStore);
        Debug.Log("Success: IAP Targeting Amazon Store");
#elif UNITY_ANDROID
        UnityPurchasingEditor.TargetAndroidStore(AppStore.GooglePlay);
        Debug.Log("Success: IAP Targeting GooglePlay Store");
#elif UNITY_IOS
        // No need to do anything.
        Debug.Log("Success: IAP Targeting Apple Store");
#else
        throw new NotSupportedException($"Target {Application.platform} not supported");
#endif
    }
 void SetUnityIAPStore_Android(AppStore appStore)
 {
     UnityPurchasingEditor.TargetAndroidStore(appStore);
 }
예제 #5
0
    static void Init()
    {
        string[] args = System.Environment.GetCommandLineArgs();
        for (int i = 0; i < args.Length; i++)
        {
            switch (args[i])
            {
            case "-packageName":
                PlayerSettings.applicationIdentifier = args[++i];
                break;

            case "-iapTarget":
                AppStore appStore = AppStore.GooglePlay;
                switch (args[++i])
                {
                case "Xiaomi":
                    appStore = AppStore.XiaomiMiPay;
                    break;

                case "GooglePlay":
                    appStore = AppStore.GooglePlay;
                    break;

                case "Amazon":
                    appStore = AppStore.AmazonAppStore;
                    break;

                case "CloudMoolah":
                    appStore = AppStore.CloudMoolah;
                    break;

                case "Samsung":
                    appStore = AppStore.SamsungApps;
                    break;
                }
                UnityPurchasingEditor.TargetAndroidStore(appStore);
                break;

            case "-apkPath":
                apkPath = args[++i];
                break;

            case "-keystoreName":
                PlayerSettings.Android.keystoreName = args[++i];
                break;

            case "-keystorePass":
                PlayerSettings.Android.keystorePass = args[++i];
                break;

            case "-keyaliasName":
                PlayerSettings.Android.keyaliasName = args[++i];
                break;

            case "-keyaliasPass":
                PlayerSettings.Android.keyaliasPass = args[++i];
                break;

            case "-productName":
                PlayerSettings.productName = args[++i];
                break;

            default:
                break;
            }
        }
    }