提交修改
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
namespace NBF.Utils
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF.Utils
|
||||
{
|
||||
public static class ItemHelper
|
||||
{
|
||||
@@ -6,5 +9,31 @@
|
||||
{
|
||||
return (ItemType)(id / 10000);
|
||||
}
|
||||
|
||||
public static string GetName(this uint id)
|
||||
{
|
||||
return Lan.Get($"Name_{id}");
|
||||
}
|
||||
|
||||
public static string GetDesc(this uint id)
|
||||
{
|
||||
return Lan.Get($"Desc_{id}");
|
||||
}
|
||||
|
||||
public static string GetIcon(this uint id)
|
||||
{
|
||||
//Assets/Resources/Icons/baitfrog.png
|
||||
return $"Icons/{id}";
|
||||
}
|
||||
|
||||
public static void SetIcon(this GLoader loader, uint id)
|
||||
{
|
||||
loader.url = id.GetIcon();
|
||||
}
|
||||
|
||||
public static void SetIcon(this GComponent loader, uint id)
|
||||
{
|
||||
loader.icon = id.GetIcon();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user