refactor: Update Unity to 2022.3.62

This commit is contained in:
2025-06-21 01:22:02 +08:00
parent d71bf7d4a5
commit 283783954f
112 changed files with 778 additions and 907 deletions

View File

@@ -25,7 +25,7 @@ namespace Cryville.Common {
/// <param name="encoding">The encoding of the string.</param>
/// <returns>The string read from the reader.</returns>
public static string ReadUInt16String(this BinaryReader reader, Encoding encoding = null) {
if (encoding == null) encoding = Encoding.UTF8;
encoding ??= Encoding.UTF8;
var len = reader.ReadUInt16();
byte[] buffer = reader.ReadBytes(len);
return encoding.GetString(buffer);
@@ -38,7 +38,7 @@ namespace Cryville.Common {
/// <param name="value">The string to write by the writer.</param>
/// <param name="encoding">The encoding of the string.</param>
public static void WriteUInt16String(this BinaryWriter writer, string value, Encoding encoding = null) {
if (encoding == null) encoding = Encoding.UTF8;
encoding ??= Encoding.UTF8;
byte[] buffer = encoding.GetBytes(value);
writer.Write((ushort)buffer.Length);
writer.Write(buffer);