Files
Fishing2/Assets/Scripts/UI/Bag/ItemDetailsPanel.cs
2025-10-23 22:59:04 +08:00

59 lines
1.4 KiB
C#

// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
using UnityEngine;
using NBC;
using NBF.Fishing2;
namespace NBF
{
public partial class ItemDetailsPanel : UIPanel
{
public ItemInfo ItemInfo;
// public
protected override void OnInit()
{
base.OnInit();
}
protected override void OnShow()
{
ItemInfo = GetData() as ItemInfo;
Quality.SetQuality(ItemInfo.Config.Quality);
Content.Basic.SetInfo(ItemInfo);
Content.Basic.SetInfo(ItemInfo);
var model = PrefabsHelper.CreatePrefab(ItemInfo.Config.Model);
Model.SetModel(model);
// LoadModel(ItemInfo.Config.Model);
Game.Input.OnUICanceled += OnUICanceled;
}
private void OnUICanceled(string action)
{
if (!IsTop) return;
if (action == InputDef.UI.SubPrev)
{
}
else if (action == InputDef.UI.SubNext)
{
}
else if (action == InputDef.UI.Up)
{
}
else if (action == InputDef.UI.Down)
{
}
}
protected override void OnHide()
{
Game.Input.OnUICanceled -= OnUICanceled;
}
}
}