using System.Collections.Generic;
using UnityEngine;

namespace XGame.Framework.ObjectCollection
{
    /// <summary>
    /// 可序列化对象收集器
    /// </summary>
    public interface IObjectCollector
    {
        Object this[string key] { get; }
        List<string> Keys { get; }
        List<Object> Objects { get; }
        /// <summary>
        /// 必须确保序列化的是GameObject才可用
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        GameObject GetGameObject(string key);
        /// <summary>
        /// 必须确保序列化的是GameObject才可用
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        T GetComponent<T>(string key) where T : Component;
    }
}
