using System.Collections.Generic; using Godot; using Godot.Collections; namespace Core; /// /// 资源集合(便于打包多个定义到一个 .tres) /// [GlobalClass] public partial class ContentCollectionResource : Resource, IContentResourceCollection { [Export] public Array Items { get; set; } = new(); public IEnumerable GetItems() { foreach (var item in Items) { if (item is IContentResource content) { yield return content; } } } }