bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class LeaveBingoCtrl : BaseCtrl
|
||||
{
|
||||
public static LeaveBingoCtrl Instance { get; private set; }
|
||||
|
||||
private LeaveBingoModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14220b336a494efea4b74371cff71e6b
|
||||
timeCreated: 1679911438
|
||||
@@ -0,0 +1,23 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class LeaveBingoModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79d90e74f1f3435f8b409a6595e30576
|
||||
timeCreated: 1679911438
|
||||
@@ -0,0 +1,75 @@
|
||||
using FairyGUI;
|
||||
using FGUI.JBingoPlay;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class LeaveBingoUI : BaseUI
|
||||
{
|
||||
private LeaveBingoUICtrl ctrl;
|
||||
private LeaveBingoModel model;
|
||||
private com_leavegame ui;
|
||||
|
||||
private bool isExit = false;
|
||||
|
||||
public LeaveBingoUI(LeaveBingoUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.LeaveBingoUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JBingoPlay";
|
||||
uiInfo.assetName = "com_leavegame";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_leavegame;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("pop_open");
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.FadeIn();
|
||||
ui.closeButton.onClick.Set(CloseClickUI);
|
||||
ui.btn_stay.onClick.Set(CloseClickUI);
|
||||
ui.btn_leave.onClick.Set(OnBtnCloseClick);
|
||||
}
|
||||
|
||||
private void CloseClickUI()
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
private void OnBtnCloseClick(EventContext context)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.EndBingoGame, true);
|
||||
CloseClickUI();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81ef446365de4957b446efdf206f9986
|
||||
timeCreated: 1679911438
|
||||
@@ -0,0 +1,72 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class LeaveBingoUICtrl : BaseUICtrl
|
||||
{
|
||||
private LeaveBingoUI ui;
|
||||
private LeaveBingoModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.LeaveBingoUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.LeaveBingoUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new LeaveBingoUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
gameDispatcher.AddListener(BingoInfo.EndBingoGame, CloseUI);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f768b1c6881b44f9b887c5c5a35c3aff
|
||||
timeCreated: 1679911438
|
||||
Reference in New Issue
Block a user