主界面相关
This commit is contained in:
24
Assets/Scripts/UI/Bag/BagPanel.Designer.cs
generated
Normal file
24
Assets/Scripts/UI/Bag/BagPanel.Designer.cs
generated
Normal 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"}; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagPanel.Designer.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/BagPanel.Designer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bbe340594e28d34b914c388db26d526
|
||||
110
Assets/Scripts/UI/Bag/BagPanel.cs
Normal file
110
Assets/Scripts/UI/Bag/BagPanel.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UI/Bag/BagPanel.cs.meta
Normal file
2
Assets/Scripts/UI/Bag/BagPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06f449f341e3a19438e38e1038fd25d5
|
||||
Reference in New Issue
Block a user