修改表结构,修改物品详情,增加物品品质描边
This commit is contained in:
3
Assets/Scripts/Common/Data.meta
Normal file
3
Assets/Scripts/Common/Data.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc83e1d6083241c08d36a271df033aa6
|
||||
timeCreated: 1761057848
|
||||
14
Assets/Scripts/Common/Data/ItemInfo.cs
Normal file
14
Assets/Scripts/Common/Data/ItemInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using NBF;
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
public partial class ItemInfo
|
||||
{
|
||||
private ItemConfig _config;
|
||||
|
||||
public ItemConfig Config
|
||||
{
|
||||
get { return _config ??= ItemConfig.Get(ConfigId); }
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Common/Data/ItemInfo.cs.meta
Normal file
3
Assets/Scripts/Common/Data/ItemInfo.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdc07f3a841e4cba821c2ae2b82b2697
|
||||
timeCreated: 1761057852
|
||||
23
Assets/Scripts/Common/Extensions/GObjectExtensions.cs
Normal file
23
Assets/Scripts/Common/Extensions/GObjectExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using FairyGUI;
|
||||
using NBF.Utils;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public static class GObjectExtensions
|
||||
{
|
||||
public static void SetQuality(this GImage image, uint quality)
|
||||
{
|
||||
image.color = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
public static void SetQuality(this GTextField image, uint quality)
|
||||
{
|
||||
image.strokeColor = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
|
||||
public static void SetTitleQuality(this GButton com, uint quality)
|
||||
{
|
||||
com.GetTextField().strokeColor = ItemHelper.GetItemQualityColor(quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1e39c262c800477e8b6e353aa1d62383
|
||||
timeCreated: 1761058048
|
||||
@@ -1,5 +1,6 @@
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF.Utils
|
||||
{
|
||||
@@ -35,5 +36,29 @@ namespace NBF.Utils
|
||||
{
|
||||
loader.icon = id.GetIcon();
|
||||
}
|
||||
|
||||
#region 品质相关
|
||||
|
||||
public static Color QualityColor0 = new Color(1, 1, 1, 0);
|
||||
public static Color QualityColor1 = new Color(96 / 255f, 160 / 255f, 224 / 255f, 1);
|
||||
public static Color QualityColor2 = new Color(0 / 255f, 138 / 255f, 255 / 255f, 1);
|
||||
public static Color QualityColor3 = new Color(126 / 255f, 0 / 255f, 255 / 255f, 1);
|
||||
public static Color QualityColor4 = new Color(220 / 255f, 50 / 255f, 50 / 255f, 1);
|
||||
public static Color QualityColor5 = new Color(255 / 255f, 108 / 255f, 0 / 255f, 1);
|
||||
|
||||
public static Color GetItemQualityColor(uint quality)
|
||||
{
|
||||
return quality switch
|
||||
{
|
||||
1 => QualityColor1,
|
||||
2 => QualityColor2,
|
||||
3 => QualityColor3,
|
||||
4 => QualityColor4,
|
||||
5 => QualityColor5,
|
||||
_ => QualityColor0
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user