Exemple #1
0
 public static void BuildWin64ToPathWithVersion()
 {
     BuildTime.RestoreSettingsIfFailed(() => {
         var buildVersion         = BuildHelperStrings.GetBuildVersion();
         var target               = BuildTarget.StandaloneWindows64;
         var options              = GetStandartPlayerOptions(target);
         options.locationPathName = BuildHelperStrings.GetBuildPath(target, buildVersion);
         BuildTime.Build(options);
     });
 }
Exemple #2
0
        /// <summary>
        /// Build project for Android with specified AndroidTargetDevice.
        /// This function change PlayerSettings and restore it after build.
        /// Different devices will get different bundle version code.
        /// See: <see cref="BuildHelperStrings.GenBundleNumber(UnityEditor.AndroidTargetDevice)"/>
        /// </summary>
        /// <param name="device">Android target device</param>
        /// <param name="buildVersion">Build version wich will be available by <i>Application.version</i></param>
        /// <param name="options">Build player options</param>
        /// <returns>Build path</returns>
        private static string BuildAndroidForDevice(AndroidTargetDevice device, string buildVersion, BuildPlayerOptions options)
        {
            BuildTime.SaveSettingsToRestore();
            PlayerSettings.Android.targetDevice      = device;
            PlayerSettings.Android.bundleVersionCode = BuildHelperStrings.GenBundleNumber(device);
            var buildPath = BuildHelperStrings.GetBuildPath(BuildTarget.Android, buildVersion, specifyName: device.ToString());

            options.locationPathName = buildPath;
            BuildTime.Build(options);
            return(buildPath);
        }
Exemple #3
0
 public static void BuildIOSToPathWithVersion()
 {
     IdentifierFormWindow.ShowIfNeedChange(BuildTargetGroup.iOS, () =>
                                           BuildTime.RestoreSettingsIfFailed(() => {
         var buildVersion = BuildHelperStrings.GetBuildVersion();
         var target       = BuildTarget.iOS;
         var options      = GetStandartPlayerOptions(target);
         BuildTime.SaveSettingsToRestore();
         PlayerSettings.iOS.buildNumber = BuildHelperStrings.GenBundleNumber().ToString();
         options.locationPathName       = BuildHelperStrings.GetBuildPath(target, buildVersion);
         BuildTime.Build(options);
     }));
 }