using UnityEngine;

namespace XGame.Framework
{
    [CreateAssetMenu(fileName = "XGameConfig", menuName = "XGame/XGame Config")]
    public sealed class XGameConfig : ScriptableObject
    {
        /// <summary>
        /// 项目名
        /// </summary>
        public string productName = "Demo";
        /// <summary>
        /// 项目的启动Assembly GUID
        /// </summary>
        public string launchAssemblyGUID;
        /// <summary>
        /// 项目的启动Assembly 名字
        /// </summary>
        public string launchAssemblyName;
        /// <summary>
        /// 项目的启动场景GUID
        /// </summary>
        public string launchSceneGUID;
        /// <summary>
        /// 项目的启动场景名字
        /// </summary>
        public string launchSceneName;

        /// <summary>
        /// 项目的启动脚本GUID
        /// XGame.Framework.IGameLogic的实现类
        /// </summary>
        public string gameLogicGUID;
        /// <summary>
        /// 项目的启动脚本名字
        /// XGame.Framework.IGameLogic的实现类
        /// </summary>
        public string gameLogicTypeName;

        #region 静态代码 Runtime用
        public static XGameConfig Load()
        {
            return Asset.AssetManager.LoadSync<XGameConfig>(Define.AssetDefine.XGAME_CONFIG_NAME);
        }
        public static void Unload(XGameConfig config)
        {
            if (config != null)
            {
                Asset.AssetManager.Recycle(config);
            }
        }
        #endregion
    }
}
