RealmGateAddressComponentSystem.cs 610 B

123456789101112131415161718192021222324252627282930
  1. using Model;
  2. namespace Hotfix
  3. {
  4. [ObjectSystem]
  5. public class RealmGateAddressComponentSystem : ObjectSystem<RealmGateAddressComponent>, IStart
  6. {
  7. public void Start()
  8. {
  9. this.Get().Start();
  10. }
  11. }
  12. public static class RealmGateAddressComponentEx
  13. {
  14. public static void Start(this RealmGateAddressComponent component)
  15. {
  16. StartConfig[] startConfigs = component.Parent.GetComponent<StartConfigComponent>().GetAll();
  17. foreach (StartConfig config in startConfigs)
  18. {
  19. if (!config.AppType.Is(AppType.Gate))
  20. {
  21. continue;
  22. }
  23. component.GateAddress.Add(config);
  24. }
  25. }
  26. }
  27. }