From d250ee1d932996e4dbb35213995e9bcdcfd07ef9 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Tue, 27 Jan 2026 23:03:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(globalusings):=20=E4=B8=BA=E6=97=A7?= =?UTF-8?q?=E7=89=88.NET=E6=A1=86=E6=9E=B6=E6=B7=BB=E5=8A=A0IsExternalInit?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在GlobalUsings.cs中添加条件编译指令支持NETSTANDARD2_0、NETFRAMEWORK和NETCOREAPP2_0 - 添加System.ComponentModel命名空间引用 - 实现IsExternalInit静态类以支持仅初始化setter语法 - 使用EditorBrowsable特性标记为隐藏状态避免IDE显示 - 确保新功能仅在目标框架版本下可用 --- GFramework.Game.Abstractions/GlobalUsings.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/GFramework.Game.Abstractions/GlobalUsings.cs b/GFramework.Game.Abstractions/GlobalUsings.cs index 4d27181..deaf08d 100644 --- a/GFramework.Game.Abstractions/GlobalUsings.cs +++ b/GFramework.Game.Abstractions/GlobalUsings.cs @@ -15,4 +15,18 @@ global using System; global using System.Collections.Generic; global using System.Linq; global using System.Threading; -global using System.Threading.Tasks; \ No newline at end of file +global using System.Threading.Tasks; +#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2_0 +using System.ComponentModel; + +namespace System.Runtime.CompilerServices +{ + /// + /// 用于标记仅初始化 setter 的特殊类型 + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static class IsExternalInit + { + } +} +#endif \ No newline at end of file