先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
59 lines
2.0 KiB
C#
59 lines
2.0 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FishcardBenefitPopupPanel : MonoBehaviour
|
|
{
|
|
Button btn_close;
|
|
Button btn_mask;
|
|
Button btn_go;
|
|
TMP_Text text_map;
|
|
TMP_Text text_level;
|
|
AquariumCardWeight[] aquariumCardWeights;
|
|
AquariumManager AM;
|
|
private void Awake()
|
|
{
|
|
AM = GContext.container.Resolve<AquariumManager>();
|
|
btn_close = transform.Find("btn_close").GetComponent<Button>();
|
|
btn_mask = transform.Find("mask").GetComponent<Button>();
|
|
text_map = transform.Find("root/bg/map/text_name").GetComponent<TMP_Text>();
|
|
text_level = transform.Find("root/bg/level/text_num").GetComponent<TMP_Text>();
|
|
aquariumCardWeights = transform.Find("root/bg/weight_bonus").GetComponentsInChildren<AquariumCardWeight>();
|
|
btn_go = transform.Find("root/bg/btn_go/btn_green").GetComponent<Button>();
|
|
}
|
|
void Start()
|
|
{
|
|
Tables _tables = GContext.container.Resolve<Tables>();
|
|
btn_close.onClick.AddListener(OnClickClose);
|
|
btn_mask.onClick.AddListener(OnClickClose);
|
|
var mapData = _tables.TbMapData.DataMap[AM.MapId];
|
|
text_map.text = LocalizationMgr.GetText(mapData.Name_l10n_key);
|
|
//string levelLV = LocalizationMgr.GetText("UI_FishingMapPanel_101006");
|
|
int fishCardLevel = GContext.container.Resolve<PlayerFishData>().GetFishLevelByMap(AM.MapId);
|
|
|
|
List<float> weight = AM.GetWeightMag();
|
|
|
|
text_level.text = /*levelLV +*/ fishCardLevel.ToString();
|
|
for (int i = 0; i < aquariumCardWeights.Length; i++)
|
|
{
|
|
aquariumCardWeights[i].text_level.text = weight[i].ToPercentageString();
|
|
}
|
|
btn_go.onClick.AddListener(GoTO);
|
|
}
|
|
|
|
async void GoTO()
|
|
{
|
|
await UIManager.Instance.ShowUI(UITypes.FishingMapPanel);
|
|
OnClickClose();
|
|
}
|
|
|
|
void OnClickClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.FishcardBenefitPopupPanel);
|
|
}
|
|
}
|