Files
MinFt/Client/Assets/Scripts/UI/Home/HomeBuffPopupPanel.cs
Liubing\LB 3d8d4d18f3 first commit
先修复一下,错误的场景

删除不必要的钓场资产

修复into场景

update:更新meta文件,修复报错

update:修复资源

修复第一章节建造

修复建造第三章

update:删除多余内容

update:更新README.md

update:还原图标

update:更新README

update:更新配置
2026-04-28 02:17:22 +08:00

61 lines
1.7 KiB
C#

using asap.core;
using UnityEngine;
using UniRx;
using System;
using GameCore;
using UnityEngine.UI;
using TMPro;
using cfg;
using Game;
public class HomeBuffPopupPanel : MonoBehaviour
{
Image icon_buff;
TMP_Text text_info;
BuffDataCenter buffDataCenter;
FishingData fishingData;
GameObject root;
Animation _ani;
IDisposable disposable;
private void Awake()
{
_ani = GetComponent<Animation>();
root = transform.Find("root").gameObject;
buffDataCenter = GContext.container.Resolve<BuffDataCenter>();
fishingData = GContext.container.Resolve<FishingData>();
icon_buff = transform.Find("root/icon_buff").GetComponent<Image>();
text_info = transform.Find("root/bg/text_info").GetComponent<TMP_Text>();
disposable = GContext.OnEvent<GetBuffPosEvent>().Subscribe(GetBuffPosEvent);
}
void GetBuffPosEvent(GetBuffPosEvent getBuffPosEvent)
{
getBuffPosEvent.Pos = icon_buff.transform.position;
}
public void Init(FishBuffTimeData fishBuffTimeData)
{
var buff = GContext.container.Resolve<cfg.Tables>().TbFishBuff.GetOrDefault(fishBuffTimeData.buffID);
if (buff != null)
{
GContext.container.Resolve<IUIService>().SetImageSprite(icon_buff, buff.Icon);
text_info.text = LocalizationMgr.GetText(buff.Title_l10n_key);
GContext.Publish(new EventUISound(buff.Audio));
}
root.SetActive(true);
_ani.Play("buff_show");
}
public void Hide()
{
root.SetActive(false);
}
public void Close()
{
UIManager.Instance.DestroyUI(UITypes.HomeBuffPopupPanel);
}
private void OnDisable()
{
disposable?.Dispose();
disposable = null;
}
}