修改表结构,修改物品详情,增加物品品质描边
This commit is contained in:
4
Assets/Scripts/UI/Bag/BagItem.Designer.cs
generated
4
Assets/Scripts/UI/Bag/BagItem.Designer.cs
generated
@@ -12,14 +12,14 @@ namespace NBF
|
||||
public const string URL = "ui://hxr7rc7puq3a1h";
|
||||
|
||||
public GImage back;
|
||||
public GImage ba;
|
||||
public GImage Quality;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
back = (GImage)GetChild("back");
|
||||
ba = (GImage)GetChild("ba");
|
||||
Quality = (GImage)GetChild("Quality");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,19 @@ namespace NBF
|
||||
{
|
||||
public partial class BagItem : GButton
|
||||
{
|
||||
public ItemInfo ItemInfo;
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,9 @@ namespace NBF
|
||||
|
||||
private void OnClickItem(object item)
|
||||
{
|
||||
if (item is not BagItem bagItem) return;
|
||||
// ItemDetailsPanel.s
|
||||
ItemDetailsPanel.Show();
|
||||
ItemDetailsPanel.Show(bagItem.ItemInfo);
|
||||
}
|
||||
|
||||
private void UseBottomMenu()
|
||||
|
||||
29
Assets/Scripts/UI/Bag/ItemBasicInfoTag.Designer.cs
generated
Normal file
29
Assets/Scripts/UI/Bag/ItemBasicInfoTag.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemBasicInfoTag
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7pnzfp1p";
|
||||
|
||||
public GTextField TextTitle;
|
||||
public GTextField TextDesc;
|
||||
public GTextField TextContent;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
TextTitle = (GTextField)GetChild("TextTitle");
|
||||
TextDesc = (GTextField)GetChild("TextDesc");
|
||||
TextContent = (GTextField)GetChild("TextContent");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemBasicInfoTag.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemBasicInfoTag.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64ece59eb75f6874b8956a0b1073c8f7
|
||||
23
Assets/Scripts/UI/Bag/ItemBasicInfoTag.cs
Normal file
23
Assets/Scripts/UI/Bag/ItemBasicInfoTag.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using NBF.Utils;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemBasicInfoTag : GComponent
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetInfo(ItemInfo itemInfo)
|
||||
{
|
||||
var itemConfig = ItemConfig.Get(itemInfo.ConfigId);
|
||||
TextTitle.text = itemInfo.ConfigId.GetName();
|
||||
TextTitle.SetQuality(itemInfo.Config.Quality);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemBasicInfoTag.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemBasicInfoTag.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62624753a7f37ea4c93a816a7ebac8e3
|
||||
@@ -11,15 +11,15 @@ namespace NBF
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7pnzfp1o";
|
||||
|
||||
public GComponent Basic;
|
||||
public GComponent Gear;
|
||||
public ItemBasicInfoTag Basic;
|
||||
public ItemGearInfoTag Gear;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
Basic = (GComponent)GetChild("Basic");
|
||||
Gear = (GComponent)GetChild("Gear");
|
||||
Basic = (ItemBasicInfoTag)GetChild("Basic");
|
||||
Gear = (ItemGearInfoTag)GetChild("Gear");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace NBF
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ namespace NBF
|
||||
{
|
||||
public partial class ItemDetailsPanel : UIPanel
|
||||
{
|
||||
public ItemInfo ItemInfo;
|
||||
|
||||
// public
|
||||
protected override void OnInit()
|
||||
{
|
||||
base.OnInit();
|
||||
@@ -14,6 +17,18 @@ namespace NBF
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
ItemInfo = GetData() as ItemInfo;
|
||||
// Model.SetModel();
|
||||
// Instance = Object.Instantiate(prefab);
|
||||
// Debug.LogError($"预制体:{prefab.name} 实例={Instance}");
|
||||
// Model.SetModel(Instance);
|
||||
|
||||
Quality.SetQuality(ItemInfo.Config.Quality);
|
||||
|
||||
|
||||
Content.Basic.SetInfo(ItemInfo);
|
||||
Content.Basic.SetInfo(ItemInfo);
|
||||
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
}
|
||||
|
||||
|
||||
29
Assets/Scripts/UI/Bag/ItemGearInfoTag.Designer.cs
generated
Normal file
29
Assets/Scripts/UI/Bag/ItemGearInfoTag.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
/**本脚本为自动生成,每次生成会覆盖!请勿手动修改,生成插件文档及项目地址:https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
|
||||
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemGearInfoTag
|
||||
{
|
||||
public const string URL = "ui://hxr7rc7pnzfp1q";
|
||||
|
||||
public GTextField TextTitle;
|
||||
public GRichTextField TextDesc;
|
||||
public GList List;
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
TextTitle = (GTextField)GetChild("TextTitle");
|
||||
TextDesc = (GRichTextField)GetChild("TextDesc");
|
||||
List = (GList)GetChild("List");
|
||||
OnInited();
|
||||
UILanguage.TrySetComponentLanguage(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemGearInfoTag.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemGearInfoTag.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6210f89fdfdedcf43ad112aee8624548
|
||||
19
Assets/Scripts/UI/Bag/ItemGearInfoTag.cs
Normal file
19
Assets/Scripts/UI/Bag/ItemGearInfoTag.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ItemGearInfoTag : GComponent
|
||||
{
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetInfo(ItemInfo itemInfo)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/ItemGearInfoTag.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/ItemGearInfoTag.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32b242aeba14ccf4e8daab2f502128e3
|
||||
@@ -21,6 +21,8 @@ namespace NBF
|
||||
UIObjectFactory.SetPackageItemExtension(ChatItem.URL, typeof(ChatItem));
|
||||
UIObjectFactory.SetPackageItemExtension(GearItem.URL, typeof(GearItem));
|
||||
UIObjectFactory.SetPackageItemExtension(ItemDetailsContent.URL, typeof(ItemDetailsContent));
|
||||
UIObjectFactory.SetPackageItemExtension(ItemBasicInfoTag.URL, typeof(ItemBasicInfoTag));
|
||||
UIObjectFactory.SetPackageItemExtension(ItemGearInfoTag.URL, typeof(ItemGearInfoTag));
|
||||
UIObjectFactory.SetPackageItemExtension(BagItem.URL, typeof(BagItem));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user