64 lines
1.5 KiB
C#
64 lines
1.5 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;
|
|
if (ItemInfo == null || ItemInfo.Config == null)
|
|
{
|
|
Hide();
|
|
return;
|
|
}
|
|
|
|
Quality.SetQuality(ItemInfo.Config.Quality);
|
|
|
|
Content.Gear.visible = false;
|
|
Content.Basic.SetInfo(ItemInfo);
|
|
Content.Gear.SetInfo(ItemInfo);
|
|
|
|
// var model = PrefabsHelper.CreatePrefab(ItemInfo.Config.Model);
|
|
Model.SetData(ItemInfo.Config);
|
|
// Model.SetBackground(Back);
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |