相关UILUOJI

This commit is contained in:
xmac
2025-05-22 22:49:32 +08:00
parent 10de589722
commit 2ca8eac832
27 changed files with 172 additions and 35 deletions

View File

@@ -8,6 +8,7 @@ namespace NBF
{
public static void BindAll()
{
UIObjectFactory.SetPackageItemExtension(CommonMenu.URL, typeof(CommonMenu));
}
}
}

View File

@@ -0,0 +1,35 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class CommonMenu
{
public const string URL = "ui://6hgkvlaufcfggr";
public GImage LongLine;
public GList List;
public GButton Head;
public GTextField TextName;
public GComponent Currency;
public GButton BtnClose;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
LongLine = (GImage)GetChild("LongLine");
List = (GList)GetChild("List");
Head = (GButton)GetChild("Head");
TextName = (GTextField)GetChild("TextName");
Currency = (GComponent)GetChild("Currency");
BtnClose = (GButton)GetChild("BtnClose");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 195be61b5e6ed4de4b8cec3c2ce8d003

View File

@@ -0,0 +1,31 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using System;
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class CommonMenu : GLabel
{
public event Action OnClose;
public event Action<int> OnTabChange;
private void OnInited()
{
BtnClose.onClick.Add(OnClickClose);
}
public void SetTabs()
{
List.RemoveChildrenToPool();
}
private void OnClickClose()
{
OnClose?.Invoke();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b18b4ca156e62462ba447a851e105615

View File

@@ -50,7 +50,7 @@ namespace NBF
{
if (string.IsNullOrEmpty(_interactiveData.Use1)) return;
Debug.Log(_interactiveData.Use1);
UI.Inst.OpenUI<FishingShop>();
UI.Inst.OpenUI<FishingShopPanel>();
}
public void Use2()

View File

@@ -8,13 +8,17 @@ using System.Collections.Generic;
namespace NBF
{
/// <summary> </summary>
public partial class FishingShop
public partial class FishingShopPanel
{
public GObject this[string aKey] => ContentPane.GetChild(aKey);
[AutoFind(Name = "Banner")]
public GLabel Banner;
[AutoFind(Name = "BtnClose")]
public GButton BtnClose;
[AutoFind(Name = "back")]
public GImage back;
[AutoFind(Name = "Menu")]
public CommonMenu Menu;
[AutoFind(Name = "divisionLine")]
public GImage divisionLine;
[AutoFind(Name = "List")]
public GList List;
public override string[] GetDependPackages(){ return new string[] {"Common"}; }

View File

@@ -7,10 +7,10 @@ using UIPanel = NBC.UIPanel;
namespace NBF
{
public partial class FishingShop : UIPanel
public partial class FishingShopPanel : UIPanel
{
public override string UIPackName => "Shop";
public override string UIResName => "FishingShop";
public override string UIResName => "FishingShopPanel";
protected override void OnInit()
{
@@ -25,10 +25,10 @@ namespace NBF
private void OnClick(GComponent btn)
{
if (btn == BtnClose)
{
Hide();
}
// if (btn == BtnClose)
// {
// Hide();
// }
}
protected override void OnHide()