mirror of
https://github.com/AssetRipper/AssetRipper.Primitives.git
synced 2026-11-13 04:26:30 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ed4298585 | ||
|
|
3e5ee80680 |
No files matched your search
@@ -53,8 +53,10 @@ public class ParsingTests
|
||||
[Test]
|
||||
public void ChinaVersionString()
|
||||
{
|
||||
string version = "2020.3.15f2c1";
|
||||
UnityVersion expected = new UnityVersion(2020, 3, 15, UnityVersionType.China, 2);
|
||||
string version = "2021.3.11f1c2";//This is an actual version from a game.
|
||||
//Versions like 2019.3.0f2 and 2020.3.15f2 don't have corresponding Chinese versions.
|
||||
//Source: https://unity.cn/releases
|
||||
UnityVersion expected = new UnityVersion(2021, 3, 11, UnityVersionType.China, 2);
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.AreEqual(expected, UnityVersion.Parse(version));
|
||||
|
||||
@@ -9,7 +9,7 @@ public readonly partial struct UnityVersion
|
||||
private static readonly Regex majorMinorRegex = new Regex(@"^([0-9]+)\.([0-9]+)$", RegexOptions.Compiled);
|
||||
private static readonly Regex majorMinorBuildRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)$", RegexOptions.Compiled);
|
||||
private static readonly Regex normalRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?([abfpx])([0-9]+)$", RegexOptions.Compiled);
|
||||
private static readonly Regex chinaRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?f([0-9]+)c1$", RegexOptions.Compiled);
|
||||
private static readonly Regex chinaRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?f1c([0-9]+)$", RegexOptions.Compiled);
|
||||
|
||||
/// <summary>
|
||||
/// Serialize the version as a string
|
||||
@@ -48,9 +48,9 @@ public readonly partial struct UnityVersion
|
||||
}
|
||||
if (Type == UnityVersionType.China)
|
||||
{
|
||||
sb.Append('f');
|
||||
sb.Append("f1");
|
||||
sb.Append('c');
|
||||
sb.Append(TypeNumber);
|
||||
sb.Append("c1");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<AssemblyName>AssetRipper.VersionUtilities</AssemblyName>
|
||||
<Authors>ds5678</Authors>
|
||||
<Company>AssetRipper</Company>
|
||||
<Version>1.3.0.0</Version>
|
||||
<Version>1.3.1.0</Version>
|
||||
<AssemblyVersion>$(Version)</AssemblyVersion>
|
||||
<PackageId>AssetRipper.VersionUtilities</PackageId>
|
||||
<PackageTags>C# version unity unity3d</PackageTags>
|
||||
|
||||
Reference in new issue
Block a user