XGameConfig.cs 1.7 KB

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