XGameConfig.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using UnityEngine;
  2. namespace XGame.Framework
  3. {
  4. [CreateAssetMenu(fileName = "XGameConfig", menuName = "XGame/XGame Config")]
  5. public sealed class XGameConfig : ScriptableObject
  6. {
  7. /// <summary>
  8. /// 项目名
  9. /// </summary>
  10. public string productName = "Demo";
  11. /// <summary>
  12. /// 项目的启动Assembly GUID
  13. /// </summary>
  14. public string launchAssemblyGUID;
  15. /// <summary>
  16. /// 项目的启动Assembly 名字
  17. /// </summary>
  18. public string launchAssemblyName;
  19. /// <summary>
  20. /// 项目的启动场景GUID
  21. /// </summary>
  22. public string launchSceneGUID;
  23. /// <summary>
  24. /// 项目的启动场景名字
  25. /// </summary>
  26. public string launchSceneName;
  27. /// <summary>
  28. /// 项目的启动脚本GUID
  29. /// XGame.Framework.IGameLogic的实现类
  30. /// </summary>
  31. public string gameLogicGUID;
  32. /// <summary>
  33. /// 项目的启动脚本名字
  34. /// XGame.Framework.IGameLogic的实现类
  35. /// </summary>
  36. public string gameLogicTypeName;
  37. #region 静态代码 Runtime用
  38. public static XGameConfig Load()
  39. {
  40. return Asset.AssetManager.LoadSync<XGameConfig>(Define.AssetDefine.XGAME_CONFIG_NAME);
  41. }
  42. public static void Unload(XGameConfig config)
  43. {
  44. if (config != null)
  45. {
  46. Asset.AssetManager.Recycle(config);
  47. }
  48. }
  49. #endregion
  50. }
  51. }