bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JThinkCtrl : BaseCtrl
|
||||
{
|
||||
public static JThinkCtrl Instance { get; private set; }
|
||||
|
||||
private JThinkModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5701843686244d59e492684da465d63
|
||||
timeCreated: 1680055505
|
||||
@@ -0,0 +1,35 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JThinkModel : BaseModel
|
||||
{
|
||||
public bool IsOpenMusic
|
||||
{
|
||||
get => Audio.Instance.IsOpenBGM;
|
||||
set => Audio.Instance.IsOpenBGM = value;
|
||||
}
|
||||
|
||||
public bool IsOpenEffect
|
||||
{
|
||||
get => Audio.Instance.IsOpenEffect;
|
||||
set => Audio.Instance.IsOpenEffect = value;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d63233519fe94591a5cc6ca9cba03a6b
|
||||
timeCreated: 1680055505
|
||||
@@ -0,0 +1,106 @@
|
||||
using FGUI.JSettings;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using UnityEngine.Device;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JThinkUI : BaseUI
|
||||
{
|
||||
private JThinkUICtrl ctrl;
|
||||
private JThinkModel model;
|
||||
private com_setting ui;
|
||||
|
||||
public JThinkUI(JThinkUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.JThinkUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JSettings";
|
||||
uiInfo.assetName = "com_setting";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.GetModel(ModelConst.JThinkModel) as JThinkModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_setting;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("pop_open");
|
||||
ui.closeButton.SetClick(() =>
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("button");
|
||||
CtrlCloseUI();
|
||||
});
|
||||
ui.btn_pri.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTermUI_Open); });
|
||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTermUI_Open, true); });
|
||||
|
||||
ui.btn_music.SetClick(OnClickMusicBtn);
|
||||
ui.btn_sound.SetClick(OnClickSoundBtn);
|
||||
ui.btn_how.SetClick(() =>
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("button");
|
||||
uiCtrlDispatcher.Dispatch(SkinInfo.BingoWhatUI_Open);
|
||||
});
|
||||
ui.btn_contact.SetClick(GameHelper.OpenEmail);
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.btn_record.visible = true;
|
||||
ui.btn_record.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(SkinInfo.MakeupRecordUI_Open);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickSoundBtn()
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("button");
|
||||
model.IsOpenEffect = !model.IsOpenEffect;
|
||||
RefreshUI();
|
||||
}
|
||||
|
||||
private void OnClickMusicBtn()
|
||||
{
|
||||
Audio.Instance.PlayDynamicEffect("button");
|
||||
model.IsOpenMusic = !model.IsOpenMusic;
|
||||
RefreshUI();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
RefreshUI();
|
||||
}
|
||||
|
||||
private void RefreshUI()
|
||||
{
|
||||
ui.text_version.SetVar("version", Application.version).FlushVars();
|
||||
|
||||
ui.text_uid.text = "UID:"+GameHelper.GetLoginModel().uid ;
|
||||
ui.btn_music.btn_on.cont_btn.selectedIndex = model.IsOpenMusic ? btn_on.Btn_on : btn_on.Btn_off;
|
||||
ui.btn_sound.btn_on.cont_btn.selectedIndex = model.IsOpenEffect ? btn_on.Btn_on : btn_on.Btn_off;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 248db99eec4545f28b04e340133c9a96
|
||||
timeCreated: 1680055505
|
||||
@@ -0,0 +1,71 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JThinkUICtrl : BaseUICtrl
|
||||
{
|
||||
private JThinkUI ui;
|
||||
private JThinkModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.JThinkUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.JThinkUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new JThinkUI(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);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b3b4d72d5c64fec9c324c24eeeaf5d1
|
||||
timeCreated: 1680055505
|
||||
Reference in New Issue
Block a user