备份CatanBuilding瘦身独立工程
This commit is contained in:
53
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel4.cs
Normal file
53
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel4.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FishingTargetPopupPanel4 : FishingTargetPopupPanelBase
|
||||
{
|
||||
TMP_Text text_num;
|
||||
Image icon_target;
|
||||
|
||||
TMP_Text text_name;
|
||||
TMP_Text text_catch;
|
||||
GameObject text_nofound;
|
||||
protected override void Awake()
|
||||
{
|
||||
text_num = transform.Find("root/target_info/info/text_num").GetComponent<TMP_Text>();
|
||||
icon_target = transform.Find("root/target_info/info/text_num/icon_target").GetComponent<Image>();
|
||||
|
||||
text_name = transform.Find("root/target_info/card_info/card_1/bg/info/text_name").GetComponent<TMP_Text>();
|
||||
text_catch = transform.Find("root/target_info/card_info/card_1/bg/info/text_catch").GetComponent<TMP_Text>();
|
||||
text_nofound = transform.Find("root/target_info/card_info/card_1/bg/info/text_nofound").gameObject;
|
||||
base.Awake();
|
||||
}
|
||||
protected override void SetTargetExtra(string icon)
|
||||
{
|
||||
var tables = GContext.container.Resolve<Tables>();
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(icon_target, icon);
|
||||
EventTargetExtraDrop eventTargetExtraDrop = _fishingEventData.GetEventTargetExtraDrop();
|
||||
|
||||
if (eventTargetExtraDrop != null)
|
||||
{
|
||||
if (eventTargetExtraDrop is ETNewItem)
|
||||
{
|
||||
ETNewItem eTNewItem = eventTargetExtraDrop as ETNewItem;
|
||||
int DropID = eTNewItem.ExtraDropList[0];
|
||||
Drop drop = GContext.container.Resolve<Tables>().TbDrop[DropID];
|
||||
text_num.text = $"+{drop.DropList.DropCountList[0]}";
|
||||
|
||||
var fishItemIDs = eTNewItem.NewItemID;
|
||||
var fishItemID = fishItemIDs[0];
|
||||
var fishItem = tables.TbItem[fishItemID];
|
||||
int fishCount = _fishingEventData.GetEtDropAfterDropDic(fishItem.RedirectID);
|
||||
text_name.text = LocalizationMgr.GetText(fishItem.Name_l10n_key) + ":";
|
||||
text_catch.gameObject.SetActive(fishCount > 0);
|
||||
text_catch.text = LocalizationMgr.GetFormatTextValue("UI_FishingTargetPopupPanel_Advanced_3", fishCount);
|
||||
text_nofound.SetActive(fishCount == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user