From 7bf59aa8982411eae4be1425f826f87c5ce7ae97 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Thu, 25 Dec 2025 01:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Editor/Version/VersionIncrementer.cs | 9 +++++++++ ProjectSettings/ProjectSettings.asset | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Assets/Editor/Version/VersionIncrementer.cs b/Assets/Editor/Version/VersionIncrementer.cs index 540d6bba6..e0fcd6720 100644 --- a/Assets/Editor/Version/VersionIncrementer.cs +++ b/Assets/Editor/Version/VersionIncrementer.cs @@ -2,6 +2,7 @@ using System; using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; +using UnityEngine; public class VersionIncrementer : IPreprocessBuildWithReport { @@ -23,5 +24,13 @@ public class VersionIncrementer : IPreprocessBuildWithReport // 更新版本号 string date = DateTime.Now.ToString("yyyyMMdd-HHmmss"); PlayerSettings.bundleVersion = $"{major}.{minor}.{revision}.{build + 1}-{date}"; + + // 如果是Android平台,自增Bundle Version Code + if (report.summary.platform == BuildTarget.Android) + { + int currentVersionCode = PlayerSettings.Android.bundleVersionCode; + PlayerSettings.Android.bundleVersionCode = currentVersionCode + 1; + Debug.Log($"Android Bundle Version Code incremented: {currentVersionCode} -> {PlayerSettings.Android.bundleVersionCode}"); + } } } \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 867389cf5..b0d64d0e5 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -133,7 +133,7 @@ PlayerSettings: vulkanEnableLateAcquireNextImage: 0 vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 - bundleVersion: 0.3.3.50-20251224-211503 + bundleVersion: 0.3.3.52-20251225-010125 preloadedAssets: - {fileID: 11400000, guid: 0fb2bc2476953fc43a74f0ab8879077c, type: 2} metroInputSource: 0 @@ -163,7 +163,7 @@ PlayerSettings: iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 1 - AndroidBundleVersionCode: 15 + AndroidBundleVersionCode: 17 AndroidMinSdkVersion: 22 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 @@ -266,7 +266,7 @@ PlayerSettings: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 - androidUseCustomKeystore: 1 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180