备份CatanBuilding瘦身独立工程
This commit is contained in:
58
Assets/Scripts/Aquarium/UI/FishcardBenefitPopupPanel.cs
Normal file
58
Assets/Scripts/Aquarium/UI/FishcardBenefitPopupPanel.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user