bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BingoHalldCtrl : BaseCtrl
|
||||
{
|
||||
public static BingoHalldCtrl Instance { get; private set; }
|
||||
|
||||
private BingoHalldModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8a3d2fa23854597bd5b4d724c8f2351
|
||||
timeCreated: 1678955049
|
||||
@@ -0,0 +1,23 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BingoHalldModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d1d5a17447b44b6b9ef9205f916152d
|
||||
timeCreated: 1678955049
|
||||
@@ -0,0 +1,163 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using DG.Tweening;
|
||||
using FGUI.ACommon;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BingoHalldUI : BaseUI
|
||||
{
|
||||
private BingoHalldUICtrl ctrl;
|
||||
private BingoHalldModel model;
|
||||
public com_maindi ui;
|
||||
|
||||
private int mTabIndex;
|
||||
|
||||
public BingoHalldUI(BingoHalldUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.BingoHalldUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ACommon";
|
||||
uiInfo.assetName = "com_maindi";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
public static BingoHalldUI Instance;
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_maindi;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
mTabIndex = (int)args;
|
||||
}
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.FadeIn();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
//Hall.Instance.AddChangeGiftSwitch(InitView);
|
||||
//GameDispatcher.Instance.AddListener(BingoInfo.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
//Hall.Instance.RemoveChangeGiftSwitch(InitView);
|
||||
// GameDispatcher.Instance.RemoveListener(BingoInfo.MainTab, OnGameTab);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch()) ui.com_di.gift.selectedIndex = 1;
|
||||
// ui.visible = false;
|
||||
//OnGameTab();
|
||||
|
||||
ui.com_di.btn_main.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_di.btn_tab_redem.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_di.btn_hall.SetClickDownEffect(0.8f, 1);
|
||||
ui.com_di.btn_h5.SetClickDownEffect(0.8f, 1);
|
||||
|
||||
ui.com_di.btn_h5.SetClick(OnClickMallTab);
|
||||
ui.com_di.btn_main.SetClick(OnClickMainTab);
|
||||
ui.com_di.btn_tab_redem.SetClick(OnClickRedeemTab);
|
||||
ui.com_di.btn_hall.SetClick(OnClickHall);
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().loginhallrate && (PlayerPrefs.GetInt("first_", 0) == 1))
|
||||
{
|
||||
OnClickHall();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnClickMainTab();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void OnClickMainTab()
|
||||
{
|
||||
OnGameTab(0);
|
||||
}
|
||||
|
||||
private void OnClickMallTab()
|
||||
{
|
||||
OnGameTab(1);
|
||||
}
|
||||
|
||||
private void OnClickRedeemTab()
|
||||
{
|
||||
OnGameTab(2);
|
||||
|
||||
}
|
||||
public void OnClickHall()
|
||||
{
|
||||
OnGameTab(3);
|
||||
|
||||
}
|
||||
public void OnGameTab(object obj)
|
||||
{
|
||||
|
||||
mTabIndex = (int)obj;
|
||||
if (mTabIndex == 0) GameDispatcher.Instance.Dispatch(BingoInfo.showBroadCast);
|
||||
else GameDispatcher.Instance.Dispatch(BingoInfo.hideBroadCast); //guangbo
|
||||
OnChangeTab(mTabIndex);
|
||||
OnClickTab(mTabIndex);
|
||||
}
|
||||
|
||||
private void OnChangeTab(int tabIndex)
|
||||
{
|
||||
ui.com_di.btn_main.cont_select.selectedIndex = tabIndex == 0 ? btn_main.Select_select : btn_main.Select_none;
|
||||
ui.com_di.btn_h5.cont_select.selectedIndex = tabIndex == 1 ? btn_h5.Select_select : btn_h5.Select_none;
|
||||
ui.com_di.btn_tab_redem.cont_select.selectedIndex = tabIndex == 2 ? btn_todo.Select_select : btn_todo.Select_none;
|
||||
ui.com_di.btn_hall.cont_select.selectedIndex = tabIndex == 3 ? btn_todo.Select_select : btn_todo.Select_none;
|
||||
}
|
||||
|
||||
private void OnClickTab(int tabIndex)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(tabIndex == 1 ? SkinInfo.JMallUI_Open : SkinInfo.JMallUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(tabIndex == 0 ? SkinInfo.BingoHallUI_Open : SkinInfo.BingoHallUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(tabIndex == 2 ? SkinInfo.BasptUI_Open : SkinInfo.BasptUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(tabIndex == 3 ? SkinInfo.H5UI_Open : SkinInfo.H5UI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.SmailUI_Open);
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.BottomUI_Open);
|
||||
Battle.Instance.SetBg(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55f83cdd2a48492f9c11e1d3bd6d2269
|
||||
timeCreated: 1678955049
|
||||
@@ -0,0 +1,89 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class BingoHalldUICtrl : BaseUICtrl
|
||||
{
|
||||
private BingoHalldUI ui;
|
||||
private BingoHalldModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.BingoHalldUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.BingoHalldUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new BingoHalldUI(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);
|
||||
uiCtrlDispatcher.AddListener(SkinInfo.MainTabUI_Display, OnMainTabUI_Display);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
uiCtrlDispatcher.RemoveListener(SkinInfo.MainTabUI_Display, OnMainTabUI_Display);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnMainTabUI_Display(object obj)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
var isShow = (bool)obj;
|
||||
if (isShow)
|
||||
{
|
||||
ui?.Display();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui?.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9d9b31df1e949b598c0f70a7c405ec4
|
||||
timeCreated: 1678955049
|
||||
Reference in New Issue
Block a user