using System; using Excel2Json; using Fort23.UTool; using UnityEngine; namespace Fort23.Mono { public class PlacesItem { public GameObjectPool gameObjectPool; public BigMapConfig bigMapConfig; private ReferenceCollector referenceCollector; public async void CustomInit(int bigMapId, GameObjectPool gameObjectPool, Action callBack = null) { this.gameObjectPool = gameObjectPool; bigMapConfig = ConfigComponent.Instance.Get(bigMapId); referenceCollector = gameObjectPool.own.GetComponent(); for (var i = 0; i < bigMapConfig.places.Length; i++) { GameObject gam = referenceCollector.Get("places_" + bigMapConfig.places[i]); PlacesWidget placesWidget = await UIManager.Instance.CreateGComponentForObject(gam, null); placesWidget.OnClick = callBack; placesWidget.CustomInit(bigMapConfig.places[i]); } } public void Dispose() { UIManager.Instance.DormancyGComponent(gameObjectPool); gameObjectPool = null; referenceCollector = null; } } }