先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
67 lines
2.4 KiB
C#
67 lines
2.4 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
|
|
public class GradeAquariumFishUI : MonoBehaviour
|
|
{
|
|
public enum FishDirection
|
|
{
|
|
Left,
|
|
Right
|
|
}
|
|
public FishDirection fishDirection;
|
|
public Button button;
|
|
public GameObject fish;
|
|
public Transform model;
|
|
public TMP_Text text_name;
|
|
public TMP_Text text_weight;
|
|
public TMP_Text text_pts;
|
|
//public GameObject empty;
|
|
public Image empty_icon;
|
|
public GameObject loading;
|
|
public FishData fishData { set; get; }
|
|
public Transform AvatarPos { set; get; }
|
|
public Fish FishGo { set; get; }
|
|
public bool isAvatar { set; get; }
|
|
public int index { set; get; }
|
|
private void Reset()
|
|
{
|
|
button = GetComponent<Button>();
|
|
fish = transform.Find("fish").gameObject;
|
|
model = transform.Find("model").GetComponent<Transform>();
|
|
text_name = transform.Find("fish/text_name").GetComponent<TMP_Text>();
|
|
text_weight = transform.Find("fish/info/text_weight").GetComponent<TMP_Text>();
|
|
text_pts = transform.Find("fish/info/text_pts").GetComponent<TMP_Text>();
|
|
//empty = transform.Find("empty").gameObject;
|
|
empty_icon = transform.Find("empty/icon").GetComponent<Image>();
|
|
loading = transform.Find("loading").gameObject;
|
|
|
|
}
|
|
public void SetData(FishData fishData, int index)
|
|
{
|
|
var _tables = GContext.container.Resolve<Tables>();
|
|
this.index = index;
|
|
this.fishData = fishData;
|
|
var playerFishData = GContext.container.Resolve<PlayerFishData>();
|
|
float maxWeight = playerFishData.GetDataMaxWeight(fishData.ID);
|
|
DropPackageList dropPackageList = _tables.TbDrop[fishData.DropID].DropList;
|
|
int maxMastery = Mathf.RoundToInt(dropPackageList.DropCountList[0] * maxWeight / fishData.BaseWeight);
|
|
fish.gameObject.SetActive(true);
|
|
loading.SetActive(true);
|
|
//empty.SetActive(false);
|
|
button.enabled = false;
|
|
text_name.text = LocalizationMgr.GetText(fishData.Name_l10n_key);
|
|
text_pts.text = LocalizationMgr.GetFormatTextValue("UI_FishingRewardPanel_101014", ConvertTools.GetNumberString2(maxMastery));
|
|
text_weight.text = LocalizationMgr.GetWeight(maxWeight);
|
|
isAvatar = maxWeight > 0;
|
|
}
|
|
public Vector3 FishModelPos()
|
|
{
|
|
return transform.localPosition + model.localPosition;
|
|
}
|
|
}
|