BigMapItem.cs 997 B

123456789101112131415161718192021222324252627
  1. using Excel2Json;
  2. using Fort23.UTool;
  3. using UnityEngine;
  4. namespace Fort23.Mono
  5. {
  6. public class BigMapItem
  7. {
  8. public GameObjectPool gameObjectPool;
  9. public WorldMapConfig worldMapConfig;
  10. private ReferenceCollector referenceCollector;
  11. public async void CustomInit(int worldMapId, GameObjectPool gameObjectPool)
  12. {
  13. this.gameObjectPool = gameObjectPool;
  14. worldMapConfig = ConfigComponent.Instance.Get<WorldMapConfig>(worldMapId);
  15. referenceCollector = gameObjectPool.own.GetComponent<ReferenceCollector>();
  16. for (var i = 0; i < worldMapConfig.bigMapId.Length; i++)
  17. {
  18. GameObject gam = referenceCollector.Get<GameObject>("map_" + worldMapConfig.bigMapId[i]);
  19. BigMapWidget bigMapWidget = await UIManager.Instance.CreateGComponentForObject<BigMapWidget>(gam, null);
  20. bigMapWidget.CustomInit(worldMapConfig.bigMapId[i]);
  21. }
  22. }
  23. }
  24. }