先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FishingRodWaytogetPopupPanel : MonoBehaviour
|
|
{
|
|
public GameObject[] gameObjects;
|
|
public Image[] images;
|
|
public TMP_Text[] tMP_Texts;
|
|
public Button[] buttons;
|
|
Button btn_close;
|
|
FishingRodUpSystem upSystem;
|
|
|
|
private void Awake()
|
|
{
|
|
upSystem = GContext.container.Resolve<FishingRodUpSystem>();
|
|
btn_close = transform.Find("btn_close").GetComponent<Button>();
|
|
for (int i = 0; i < buttons.Length; i++)
|
|
{
|
|
buttons[i].onClick.AddListener(OnClickGo);
|
|
}
|
|
btn_close.onClick.AddListener(OnClickClose);
|
|
}
|
|
private void Start()
|
|
{
|
|
var data = upSystem.GetCurrentRodItemData();
|
|
cfg.RodData rodData = data.config;
|
|
List<int> GetFromFishingBox = rodData.GetFromFishingBox;
|
|
|
|
for (int i = 0; i < gameObjects.Length; i++)
|
|
{
|
|
if (i < GetFromFishingBox.Count)
|
|
{
|
|
cfg.Item item = GContext.container.Resolve<Tables>().GetItemData(GetFromFishingBox[i]);
|
|
tMP_Texts[i].text = LocalizationMgr.GetText(item.Name_l10n_key);
|
|
GContext.container.Resolve<IUIService>().SetImageSprite(images[i], item.Icon, BasePanel.PanelName);
|
|
}
|
|
else
|
|
{
|
|
gameObjects[i].SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
private async void OnClickGo()
|
|
{
|
|
await UIManager.Instance.ShowUI(UITypes.FishingShopPanel);
|
|
UIManager.Instance.DestroyUI(UITypes.FishingRodBagPanel);
|
|
UIManager.Instance.DestroyUI(UITypes.FishingRodPanel);
|
|
GContext.Publish(new LackOfResourceConfirmEvent() { state = 1 });
|
|
OnClickClose();
|
|
}
|
|
private void OnClickClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(gameObject.name);
|
|
}
|
|
|
|
}
|