快速使用相关
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using NBC;
|
||||
using NBF.Utils;
|
||||
using Log = NBC.Log;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -12,23 +14,35 @@ namespace NBF
|
||||
{
|
||||
public ItemInfo ItemInfo;
|
||||
|
||||
// private string iconStr;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
draggable = true;
|
||||
onDragStart.Add(context =>
|
||||
{
|
||||
context.PreventDefault();
|
||||
DragDropManager.inst.StartDrag(this, this.icon, this.icon, (int)context.data);
|
||||
});
|
||||
onDragStart.Add(DragStart);
|
||||
}
|
||||
|
||||
|
||||
private void DragStart(EventContext context)
|
||||
{
|
||||
context.PreventDefault();
|
||||
DragDropManager.inst.StartDrag(this, this.icon, this.icon, (int)context.data);
|
||||
// icon = string.Empty;
|
||||
}
|
||||
|
||||
public virtual void SetData(ItemInfo itemInfo)
|
||||
{
|
||||
draggable = false;
|
||||
ItemInfo = itemInfo;
|
||||
title = itemInfo.ConfigId.GetName();
|
||||
this.SetIcon(itemInfo.ConfigId);
|
||||
Quality.SetQuality(ItemInfo.Config.Quality);
|
||||
this.SetTitleQuality(ItemInfo.Config.Quality);
|
||||
// iconStr = icon;
|
||||
}
|
||||
|
||||
public void UpdateIcon()
|
||||
{
|
||||
this.SetIcon(ItemInfo.ConfigId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user