主界面相关

This commit is contained in:
bob
2025-06-03 14:28:20 +08:00
parent 8ba78d5d1c
commit 9334999332
43 changed files with 534 additions and 14 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5592fb43d74d441cad5b1867e7e5b373
timeCreated: 1748922642

View File

@@ -0,0 +1,24 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
using System.Collections.Generic;
namespace NBF
{
/// <summary> </summary>
public partial class BagPanel
{
public GObject this[string aKey] => ContentPane.GetChild(aKey);
[AutoFind(Name = "back")]
public GImage back;
[AutoFind(Name = "Menu")]
public CommonMenu Menu;
[AutoFind(Name = "BottomMenu")]
public BottomMenu BottomMenu;
public override string[] GetDependPackages(){ return new string[] {"Common"}; }
}
}

View File

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

View File

@@ -0,0 +1,110 @@
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
using UnityEngine;
using NBC;
namespace NBF
{
public partial class BagPanel : UIPanel
{
public override string UIPackName => "Main";
public override string UIResName => "BagPanel";
protected override void OnInit()
{
base.OnInit();
Menu.OnTabChange += ChangeTab;
}
protected override void OnShow()
{
InputManager.OnUICanceled += OnUICanceled;
UseBottomMenu();
}
private void OnUICanceled(string action)
{
if (action == InputDef.UI.SubPrev)
{
}
else if (action == InputDef.UI.SubNext)
{
}
else if (action == InputDef.UI.Up)
{
}
else if (action == InputDef.UI.Down)
{
}
}
private void ChangeTab(int index)
{
if (index < 0) return;
Log.Info($"Change tab index={index}");
}
private void UseBottomMenu()
{
BottomMenu.OnTab += () =>
{
var i = Random.Range(1, 13);
if (i < 3)
{
Notices.Success("离开晶科科技看就看");
}
else if (i < 6)
{
Notices.Warning("离开晶科科技看就看");
}
else if (i < 9)
{
Notices.Error("离开晶科科技看就看");
}
else if (i < 12)
{
Notices.Info("离开晶科科技看就看");
}
};
BottomMenu.OnBack += OnBack;
BottomMenu.OnEnter += OnApplySettings;
BottomMenu.Use();
}
private void OnApplySettings()
{
}
private void OnBack()
{
if (Settings.Instance.HaveNotAppleSettings())
{
MessageBox.Show("还有未保存的信息", (b) =>
{
if (b)
{
Hide();
}
});
}
else
{
Hide();
}
}
protected override void OnHide()
{
BottomMenu.OnBack -= OnBack;
// BottomMenu.OnTab -= OnResetSettings;
BottomMenu.OnEnter -= OnApplySettings;
BottomMenu.UnUse();
InputManager.OnUICanceled -= OnUICanceled;
}
protected override void OnDestroy()
{
base.OnDestroy();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 06f449f341e3a19438e38e1038fd25d5

View File

@@ -10,6 +10,9 @@ namespace NBF
{
UIObjectFactory.SetPackageItemExtension(SettingItem.URL, typeof(SettingItem));
UIObjectFactory.SetPackageItemExtension(IntroduceTag.URL, typeof(IntroduceTag));
UIObjectFactory.SetPackageItemExtension(HomeMainPage.URL, typeof(HomeMainPage));
UIObjectFactory.SetPackageItemExtension(HomeActivityPage.URL, typeof(HomeActivityPage));
UIObjectFactory.SetPackageItemExtension(HomeRankPage.URL, typeof(HomeRankPage));
UIObjectFactory.SetPackageItemExtension(HomeButtonGroups.URL, typeof(HomeButtonGroups));
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b5d30c3ef7804f5e9f690e364ef1afe9
timeCreated: 1748923189

View File

@@ -26,6 +26,10 @@ namespace NBF
{
UI.Inst.OpenUI<SettingPanel>();
}
else if (btn == BtnBag)
{
UI.Inst.OpenUI<BagPanel>();
}
}
}
}

View File

@@ -11,12 +11,10 @@ namespace NBF
public partial class HomePanel
{
public GObject this[string aKey] => ContentPane.GetChild(aKey);
[AutoFind(Name = "Pages")]
public GComponent Pages;
[AutoFind(Name = "Menu")]
public CommonMenu Menu;
[AutoFind(Name = "BottomMenu")]
public BottomMenu BottomMenu;
[AutoFind(Name = "OpGroup")]
public HomeButtonGroups OpGroup;
public override string[] GetDependPackages(){ return new string[] {"Common"}; }

View File

@@ -1,7 +1,10 @@
// 本脚本只在不存在时会生成一次。已存在不会再次生成覆盖
using System.Collections.Generic;
using FairyGUI;
using UnityEngine;
using NBC;
using UIPanel = NBC.UIPanel;
namespace NBF
{
@@ -9,20 +12,80 @@ namespace NBF
{
public override string UIPackName => "Main";
public override string UIResName => "HomePanel";
private string[] PageNames = new[] { "HomeMainPage", "HomeActivityPage", "HomeRankPage" };
private List<HomePageBase> _pages = new List<HomePageBase>();
private HomePageBase _currentPage;
private List<TabListData> tabList = new List<TabListData>();
protected override void OnInit()
{
base.OnInit();
foreach (var group in PageNames)
{
var tab = new TabListData
{
Name = group
};
tabList.Add(tab);
}
Menu.OnTabChange += ChangeTab;
}
protected override void OnShow()
{
base.OnShow();
Menu.SetTabs(tabList);
ChangeTab(0);
}
#region Tab切换
private void ChangeTab(int index)
{
if (index < 0) return;
Log.Info($"Change tab index={index}");
foreach (var page in _pages)
{
page.Hide();
}
var nowPage = GetPage(index);
if (nowPage != null)
{
nowPage.Show();
_currentPage = nowPage;
}
}
private HomePageBase GetPage(int index)
{
var page = _pages.Find(t => t.Page == index);
if (page == null)
{
var pageName = PageNames[index];
var pageObject = UIPackage.CreateObject(UIPackName, pageName);
if (pageObject is HomePageBase homePage)
{
Pages.AddChild(homePage);
_pages.Add(homePage);
return homePage;
}
return null;
}
return page;
}
#endregion
protected override void OnHide()
{
base.OnHide();
}
protected override void OnDestroy()

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f5d43fc98c14648867dc3b696917e65
timeCreated: 1748923139

View File

@@ -0,0 +1,25 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class HomeActivityPage
{
public const string URL = "ui://hxr7rc7plvql11";
public BottomMenu BottomMenu;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
BottomMenu = (BottomMenu)GetChild("BottomMenu");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5cee4ebc54c0f434f9443cee69971ab3

View File

@@ -0,0 +1,23 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class HomeActivityPage : HomePageBase
{
private void OnInited()
{
}
protected override void OnShow()
{
}
protected override void OnHide()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7341727571ae65c4bbc3ce2bd9a94e8b

View File

@@ -0,0 +1,27 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class HomeMainPage
{
public const string URL = "ui://hxr7rc7plvql10";
public HomeButtonGroups OpGroup;
public BottomMenu BottomMenu;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
OpGroup = (HomeButtonGroups)GetChild("OpGroup");
BottomMenu = (BottomMenu)GetChild("BottomMenu");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 044cd5f648db2c94ea89ef77f1891ed4

View File

@@ -0,0 +1,64 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class HomeMainPage : HomePageBase
{
private void OnInited()
{
}
protected override void OnShow()
{
InputManager.OnUICanceled += OnUICanceled;
UseBottomMenu();
}
protected override void OnHide()
{
BottomMenu.OnBack -= OnBack;
BottomMenu.OnEnter -= OnApplySettings;
BottomMenu.UnUse();
InputManager.OnUICanceled -= OnUICanceled;
}
private void OnUICanceled(string action)
{
if (action == InputDef.UI.SubPrev)
{
}
else if (action == InputDef.UI.SubNext)
{
}
else if (action == InputDef.UI.Up)
{
}
else if (action == InputDef.UI.Down)
{
}
}
private void UseBottomMenu()
{
BottomMenu.OnBack += OnBack;
BottomMenu.OnEnter += OnApplySettings;
BottomMenu.Use();
}
private void OnApplySettings()
{
}
private void OnBack()
{
UI.Inst.HideUI<HomePanel>();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 648dd38953354c94a89c7c23d24abeb3

View File

@@ -0,0 +1,48 @@
using FairyGUI;
namespace NBF
{
public abstract class HomePageBase : GComponent
{
public int Page;
public void Show()
{
ShowAnimation();
OnShow();
}
public void Hide()
{
if (visible)
{
HideAnimation();
OnHide();
}
}
#region Anim
private void ShowAnimation()
{
visible = true;
alpha = 0;
GTween.Kill(this);
TweenFade(1, 0.5f);
}
private void HideAnimation()
{
GTween.Kill(this);
TweenFade(0, 0.2f).OnComplete(() =>
{
visible = false;
});
}
#endregion
protected abstract void OnShow();
protected abstract void OnHide();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fb0a4fb73e0c4eafa11ab8028331637b
timeCreated: 1748925820

View File

@@ -0,0 +1,25 @@
/**本脚本为自动生成每次生成会覆盖请勿手动修改生成插件文档及项目地址https://git.whoot.com/whoot-games/whoot.fguieditorplugin**/
using FairyGUI;
using FairyGUI.Utils;
using NBC;
namespace NBF
{
public partial class HomeRankPage
{
public const string URL = "ui://hxr7rc7plvql12";
public BottomMenu BottomMenu;
public override void ConstructFromXML(XML xml)
{
base.ConstructFromXML(xml);
BottomMenu = (BottomMenu)GetChild("BottomMenu");
OnInited();
UILanguage.TrySetComponentLanguage(this);
}
}
}

View File

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

View File

@@ -0,0 +1,25 @@
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
using UnityEngine;
using FairyGUI;
using NBC;
namespace NBF
{
public partial class HomeRankPage : HomePageBase
{
private void OnInited()
{
}
protected override void OnShow()
{
}
protected override void OnHide()
{
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 40506befb27a31a4786085ec5416efc7

View File

@@ -94,7 +94,6 @@ namespace NBF
}
};
BottomMenu.OnBack += OnBack;
// BottomMenu.OnTab += OnResetSettings;
BottomMenu.OnEnter += OnApplySettings;
BottomMenu.Use();
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="100,100">
<controller name="show" pages="0,,1," selected="0"/>
<displayList/>
</component>

View File

@@ -191,6 +191,7 @@
<component id="nmzbk8" name="ButtonSubIconTab.xml" path="/Com/Menu/" exported="true"/>
<image id="nmzbl6" name="LDR_LLL1_0.png" path="/Images/bluenoise64/" exported="true" scale="tile" scale9grid="0,0,64,64"/>
<component id="tmu81h" name="WeatherInfo.xml" path="/Com/" exported="true"/>
<component id="lvqll7" name="CommonContainer.xml" path="/Com/" exported="true"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Common" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080">
<displayList>
<image id="n0_lvql" name="back" src="kryob" fileName="Images/Square.png" pkg="6hgkvlau" xy="0,0" size="1920,1080" color="#182128">
<relation target="" sidePair="width-width,height-height"/>
</image>
<component id="n1_lvql" name="Menu" src="fcfggr" fileName="Com/Menu/CommonMenu.xml" pkg="6hgkvlau" xy="0,0">
<relation target="" sidePair="width-width,center-center,top-top"/>
</component>
<component id="n2_lvql" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,992" size="1920,88">
<relation target="" sidePair="width-width,center-center,bottom-bottom"/>
</component>
</displayList>
</component>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080">
<displayList>
<component id="n1_lvql" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,992">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<text id="n2_lvql" name="n2" xy="237,428" size="71,35" fontSize="25" color="#ffffff" text="Activi"/>
</displayList>
</component>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080">
<displayList>
<component id="n0_lvql" name="OpGroup" src="lvqln" fileName="Com/Home/HomeButtonGroups.xml" xy="79,179">
<relation target="" sidePair="middle-middle,left-left"/>
</component>
<component id="n1_lvql" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,992">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
</displayList>
</component>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component size="1920,1080">
<displayList>
<component id="n1_lvql" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,992">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<text id="n2_lvql" name="n2" xy="237,428" size="65,35" fontSize="25" color="#ffffff" text="Rank"/>
</displayList>
</component>

View File

@@ -7,14 +7,11 @@
<image id="n30_nmzb" name="n30" src="nmzbl6" fileName="Images/bluenoise64/LDR_LLL1_0.png" pkg="6hgkvlau" xy="0,0" size="1920,1080" alpha="0.2">
<relation target="" sidePair="width-width,height-height"/>
</image>
<component id="n32_lvql" name="Pages" src="lvqll7" fileName="Com/CommonContainer.xml" pkg="6hgkvlau" xy="0,0" size="1920,1080">
<relation target="" sidePair="width-width,height-height"/>
</component>
<component id="n1_nmzb" name="Menu" src="fcfggr" fileName="Com/Menu/CommonMenu.xml" pkg="6hgkvlau" xy="0,0" size="1920,125">
<relation target="" sidePair="width-width,center-center,top-top"/>
</component>
<component id="n2_nmzb" name="BottomMenu" src="9mf1z" fileName="Com/Menu/BottomMenu.xml" pkg="6hgkvlau" xy="0,992">
<relation target="" sidePair="center-center,bottom-bottom"/>
</component>
<component id="n19_nmzb" name="OpGroup" src="lvqln" fileName="Com/Home/HomeButtonGroups.xml" xy="79,179">
<relation target="" sidePair="middle-middle,left-left"/>
</component>
</displayList>
</component>

View File

@@ -33,6 +33,10 @@
<image id="lvqlw" name="Cup.png" path="/Images/"/>
<image id="lvqlx" name="Fire.png" path="/Images/"/>
<image id="lvqly" name="Bag.png" path="/Images/"/>
<component id="lvqlz" name="BagPanel.xml" path="/" exported="true"/>
<component id="lvql10" name="HomeMainPage.xml" path="/Com/Home/Pages/" exported="true"/>
<component id="lvql11" name="HomeActivityPage.xml" path="/Com/Home/Pages/" exported="true"/>
<component id="lvql12" name="HomeRankPage.xml" path="/Com/Home/Pages/" exported="true"/>
</resources>
<publish name="" path="../Assets/Resources/Fgui/Main" packageCount="2" genCode="true"/>
</packageDescription>

View File

@@ -0,0 +1 @@
{"url":"ui://hxr7rc7plvql10","name":"HomeMainPage","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -0,0 +1 @@
{"url":"ui://hxr7rc7plvql11","name":"HomeActivityPage","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -0,0 +1 @@
{"url":"ui://hxr7rc7plvql12","name":"HomeRankPage","scriptType":"component","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -0,0 +1 @@
{"url":"ui://hxr7rc7plvqlz","name":"BagPanel","scriptType":"panel","isCustomName":false,"customName":"","annotation":"","member":{}}

View File

@@ -130,7 +130,7 @@ QualitySettings:
globalTextureMipmapLimit: 0
textureMipmapLimitSettings: []
anisotropicTextures: 2
antiAliasing: 8
antiAliasing: 2
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1