备份CatanBuilding瘦身独立工程
This commit is contained in:
77
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs
Normal file
77
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TargetInfoBase : MonoBehaviour
|
||||
{
|
||||
Tables _tables => GContext.container.Resolve<Tables>();
|
||||
public List<Image> images;
|
||||
public List<TMP_Text> texts;
|
||||
public List<Image> icon_target = new List<Image>();
|
||||
MapFishList mapFishList;
|
||||
List<FishData> _fishDatas;
|
||||
|
||||
//根据地图特定鱼掉落积分
|
||||
public void SetData(ETDropByFish eTDropByFish)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
List<MapFishList> _mapFishList = eTDropByFish.ExtraDropList;
|
||||
FishingData fishingData = GContext.container.Resolve<FishingData>();
|
||||
for (int i = 0; i < _mapFishList.Count; i++)
|
||||
{
|
||||
if (_mapFishList[i].MapID == fishingData.MapId)
|
||||
{
|
||||
mapFishList = _mapFishList[i];
|
||||
SetShowUI();
|
||||
gameObject.SetActive(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//根据颜色掉落积分
|
||||
public void SetData(ETDropAfterDrop eTDropAfterDrop)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
List<int> DropIDList = eTDropAfterDrop.ExtraDropList;
|
||||
Drop drop;
|
||||
for (int i = 0; i < DropIDList.Count; i++)
|
||||
{
|
||||
drop = _tables.TbDrop[DropIDList[i]];
|
||||
texts[i].text = drop.DropList.DropProbList[0].ToPercentageString();
|
||||
}
|
||||
}
|
||||
//额外的鱼
|
||||
public void SetData(ETNewItem eTNewItem)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
Item item = _tables.TbItem[eTNewItem.NewItemID[0]];
|
||||
FishData fishData = _tables.TbFishData[item.RedirectID];
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(images[0], fishData.Portrait, BasePanel.PanelName);
|
||||
int dropID = eTNewItem.ExtraDropList[0];
|
||||
Drop drop = _tables.TbDrop[dropID];
|
||||
texts[0].text = $"+{drop.DropList.DropCountList[0]}";
|
||||
|
||||
//Drop drop = _tables.TbDrop[fishData.DropID];
|
||||
//texts[0].text = $"+{drop.DropList.DropCountList[2]}";
|
||||
}
|
||||
void SetShowUI()
|
||||
{
|
||||
FishData fishData;
|
||||
List<int> FishIDList = mapFishList.FishIDList;
|
||||
List<int> DropIDList = mapFishList.DropIDList;
|
||||
int count = FishIDList.Count;
|
||||
_fishDatas = new List<FishData>();
|
||||
|
||||
for (int i = 0; i < images.Count; i++)
|
||||
{
|
||||
fishData = _tables.TbFishData[FishIDList[i]];
|
||||
_fishDatas.Add(fishData);
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(images[i], fishData.Portrait, BasePanel.PanelName);
|
||||
Drop drop = _tables.TbDrop[DropIDList[i]];
|
||||
texts[i].text = $"+{drop.DropList.DropCountList[0]}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user