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;
}
}