From 9f618804df4b4efb0c3360a55755b3d6686e5032 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Mon, 28 Apr 2025 20:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E7=A1=AEnull=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/Spine/SkeletonConverter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SpineViewer/Spine/SkeletonConverter.cs b/SpineViewer/Spine/SkeletonConverter.cs index 0785456..d0bf83c 100644 --- a/SpineViewer/Spine/SkeletonConverter.cs +++ b/SpineViewer/Spine/SkeletonConverter.cs @@ -168,7 +168,7 @@ namespace SpineViewer.Spine // 无符号右移, 符号按原样设置在最高位, 其他位与符号异或 return optimizePositive ? val : (val >>> 1) ^ -(val & 1); } - public string ReadString() + public string? ReadString() { int byteCount = ReadVarInt(); switch (byteCount) @@ -181,7 +181,7 @@ namespace SpineViewer.Spine ReadFully(buffer, 0, byteCount); return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); } - public string ReadStringRef() + public string? ReadStringRef() { int index = ReadVarInt(); return index == 0 ? null : StringTable[index - 1]; @@ -276,7 +276,7 @@ namespace SpineViewer.Spine } output.WriteByte(b); } - public void WriteString(string val) + public void WriteString(string? val) { if (val == null) { @@ -294,7 +294,7 @@ namespace SpineViewer.Spine System.Text.Encoding.UTF8.GetBytes(val, 0, val.Length, buffer, 0); WriteFully(buffer, 0, byteCount); } - public void WriteStringRef(string val) + public void WriteStringRef(string? val) { if (val is null) {