From b4fa65081ff7e60df1e9861669c2a9c213130ce7 Mon Sep 17 00:00:00 2001 From: SimonDarksideJ Date: Mon, 6 May 2024 11:36:13 +0100 Subject: [PATCH] Backporting 2020 fix for recent update --- Editor/Utilities/AssemblyDefinitionPostprocessor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Editor/Utilities/AssemblyDefinitionPostprocessor.cs b/Editor/Utilities/AssemblyDefinitionPostprocessor.cs index 7c3ded8..ce6f15f 100644 --- a/Editor/Utilities/AssemblyDefinitionPostprocessor.cs +++ b/Editor/Utilities/AssemblyDefinitionPostprocessor.cs @@ -49,7 +49,11 @@ private void OnPreprocessAsset() if (packageVersion.Contains("-pre.")) { +#if UNITY_2021_1_OR_NEWER packageVersion = packageVersion[..packageVersion.IndexOf("-", StringComparison.Ordinal)]; +#else + packageVersion = packageVersion.Substring(0, packageVersion.IndexOf("-", StringComparison.Ordinal)); +#endif } var newVersion = $"[assembly: AssemblyVersion(\"{packageVersion}\")]";