GlobalConfigComponent.cs 509 B

123456789101112131415161718192021222324
  1. namespace ETModel
  2. {
  3. [ObjectSystem]
  4. public class GlobalConfigComponentAwakeSystem : AwakeSystem<GlobalConfigComponent>
  5. {
  6. public override void Awake(GlobalConfigComponent t)
  7. {
  8. t.Awake();
  9. }
  10. }
  11. public class GlobalConfigComponent : Component
  12. {
  13. public static GlobalConfigComponent Instance;
  14. public GlobalProto GlobalProto;
  15. public void Awake()
  16. {
  17. Instance = this;
  18. string configStr = ConfigHelper.GetGlobal();
  19. this.GlobalProto = JsonHelper.FromJson<GlobalProto>(configStr);
  20. }
  21. }
  22. }