GlobalConfigComponentSystem.cs 462 B

123456789101112131415
  1. using UnityEngine;
  2. namespace ET
  3. {
  4. [ObjectSystem]
  5. public class GlobalConfigComponentAwakeSystem : AwakeSystem<GlobalConfigComponent>
  6. {
  7. public override void Awake(GlobalConfigComponent self)
  8. {
  9. GameObject config = (GameObject)ResourcesHelper.Load("KV");
  10. string configStr = config.Get<TextAsset>("GlobalProto").text;
  11. self.GlobalProto = JsonHelper.FromJson<GlobalProto>(configStr);
  12. }
  13. }
  14. }