#nullable enable namespace GFramework.Godot.SourceGenerators.Abstractions; /// /// 标记 Godot 节点字段,Source Generator 会为其生成节点获取逻辑。 /// [AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)] public sealed class GetNodeAttribute : Attribute { /// /// 初始化 的新实例。 /// public GetNodeAttribute() { } /// /// 初始化 的新实例,并指定节点路径。 /// /// 节点路径。 public GetNodeAttribute(string path) { Path = path; } /// /// 获取或设置节点路径。未设置时将根据字段名推导。 /// public string? Path { get; set; } /// /// 获取或设置节点是否必填。默认为 true。 /// public bool Required { get; set; } = true; /// /// 获取或设置节点查找模式。默认为 。 /// public NodeLookupMode Lookup { get; set; } = NodeLookupMode.Auto; }