| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 | using Core.Language;using Excel2Json;using Fort23.Core;using Fort23.UTool;namespace Fort23.Mono{    [UIBinding(prefab = "PlacesInfoPanel")]    public partial class PlacesInfoPanel : UIPanel    {        private int placesId;        private void Init()        {            isPopUi = true;            isAddStack = false;        }        protected override void AddEvent()        {        }        protected override void DelEvent()        {        }        public override void AddButtonEvent()        {            Btn_Go.onClick.AddListener(Click_Go);            Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });        }        public override CTask<bool> AsyncInit(object[] uiData)        {            placesId = (int)(uiData[0]);            PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(placesId);            BigMapConfig bigMapConfig = ConfigComponent.Instance.Get<BigMapConfig>(placesConfig.bigMapID);            Text_BigMapName.text = LanguageManager.Instance.Text(bigMapConfig.mapName);            Text_PlacesName.text = LanguageManager.Instance.Text(placesConfig.placeName);            Text_PlacesComplteProgress.text = $"完成度:{PlayerManager.Instance.GetMapBl(placesId)}%";            return base.AsyncInit(uiData);        }        private async void Click_Go()        {            if (placesId > 1 && PlayerManager.Instance.GetMapBl(placesId - 1) < 100)            {                TipMessagePanel.OpenTipMessagePanel("上一个关卡没有解锁");                return;            }            AccountFileInfo.PlacesData currentPlacesData = PlayerManager.Instance.GetPlacesData(placesId);            if (currentPlacesData == null)            {                currentPlacesData = new AccountFileInfo.PlacesData();                currentPlacesData.id = placesId;                AccountFileInfo.Instance.playerData.placesDatas.Add(currentPlacesData);            }            PlayerManager.Instance.CurrentPlaces = currentPlacesData;            UIManager.Instance.HideUIUIPanel<LevelChoosePanel>();            UIManager.Instance.HideUIUIPanel(this);            EventManager.Instance.Dispatch(CustomEventType.ChangeMap, null);        }        public static async CTask OpenPanel(int placesId)        {            await UIManager.Instance.LoadAndOpenPanel<PlacesInfoPanel>(null, UILayer.Top, uiData: new object[] { placesId });        }    }}
 |