34 lines
913 B
C#
34 lines
913 B
C#
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
|
|
|
using UnityEngine;
|
|
using FairyGUI;
|
|
using Fantasy;
|
|
using NBC;
|
|
using NBF.Utils;
|
|
|
|
namespace NBF
|
|
{
|
|
public partial class BagItem : GButton
|
|
{
|
|
public ItemInfo ItemInfo;
|
|
|
|
private void OnInited()
|
|
{
|
|
draggable = true;
|
|
onDragStart.Add(context =>
|
|
{
|
|
context.PreventDefault();
|
|
DragDropManager.inst.StartDrag(this, this.icon, this.icon, (int)context.data);
|
|
});
|
|
}
|
|
|
|
public virtual void SetData(ItemInfo itemInfo)
|
|
{
|
|
ItemInfo = itemInfo;
|
|
title = itemInfo.ConfigId.GetName();
|
|
this.SetIcon(itemInfo.ConfigId);
|
|
Quality.SetQuality(ItemInfo.Config.Quality);
|
|
this.SetTitleQuality(ItemInfo.Config.Quality);
|
|
}
|
|
}
|
|
} |