bingo 项目提交

This commit is contained in:
2026-04-20 13:49:36 +08:00
commit ad5920ac6a
5585 changed files with 1216243 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3fb40ee181b6943beb2c958735eab6bd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using BingoBrain.Core;
using BingoBrain;
namespace BingoBrain
{
public class AdcomingCtrl : BaseCtrl
{
public static AdcomingCtrl Instance { get; private set; }
private AdcomingModel model;
#region
protected override void OnInit()
{
Instance = this;
//model = ModuleManager.Instance..GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
#region
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
protected override void AddServerListener()
{
}
protected override void RemoveServerListener()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c8bd042de9ef64e59b65fefb9788f71d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using BingoBrain.Core;
namespace BingoBrain
{
public class AdcomingModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
#region
protected override void OnReadData()
{
}
#endregion
#region
protected override void WriteLocalStorage()
{
}
#endregion
#region
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 29789969ee11944f8be5196fc0b81532
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,108 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;
using BingoBrain.Core;
using BingoBrain;
using FGUI.G008_reward_animal;
using DG.Tweening;
namespace BingoBrain
{
public class AdcomingUI : BaseUI
{
private AdcomingUICtrl ctrl;
private AdcomingModel model;
private FGUI.G008_reward_animal.com_adcoming ui;
public AdcomingUI(AdcomingUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.AdcomingUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "G008_reward_animal";
uiInfo.assetName = "com_adcoming";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.G008_reward_animal.com_adcoming;
}
protected override void OnOpenBefore(object args)
{
InitView();
}
protected override void OnOpen(object args)
{
}
protected override void OnHide()
{
}
protected override void OnDisplay(object args)
{
}
#endregion
#region
protected override void AddListener()
{
GameDispatcher.Instance.AddListener(GameMsg.pack_close, playAni);
}
protected override void RemoveListener()
{
GameDispatcher.Instance.RemoveListener(GameMsg.pack_close, playAni);
}
#endregion
private int time = 5;
//初始化页面逻辑
private void InitView()
{
ui.time_text.text = time.ToString();
tweer = DOVirtual.Float(time, 0, time, value => { ui.time_text.text = ((int)value).ToString(); });
tweer.onComplete += () =>
{
CtrlCloseUI();
GameHelper.ShowInterstitial("interstitial_gameend");
};
ui.btn_removead.SetClick(() =>
{
PackRewardData param = new PackRewardData();
param.isAutoPop = false;
param.isNeedScroll = true;
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
tweer.Pause();
});
}
private Tween tweer;
void playAni(object a)
{
tweer.Play();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfe9a378b6c07410b91e71ce80c75a05
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,77 @@
using System.Collections;
using System.Collections.Generic;
using BingoBrain.Core;
using BingoBrain;
namespace BingoBrain
{
public class AdcomingUICtrl : BaseUICtrl
{
private AdcomingUI ui;
private AdcomingModel model;
private uint openUIMsg = UICtrlMsg.AdcomingUI_Open;
private uint closeUIMsg = UICtrlMsg.AdcomingUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new AdcomingUI(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);
}
protected override void AddServerListener()
{
}
protected override void RemoveServerListener()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dbf393f35eff5477da2f9c69a02c3822
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 654b0dc889024f888802c7b60739037b
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BasptCtrl : BaseCtrl
{
public static BasptCtrl Instance { get; private set; }
private BasptModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 360b40412f6e4cfea0eca27b1269c533
timeCreated: 1678955969
@@ -0,0 +1,23 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BasptModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8895750960484275b3def656256fdb28
timeCreated: 1678955969
+197
View File
@@ -0,0 +1,197 @@
using FairyGUI;
using System.Linq;
using BingoBrain.Core;
using UnityEngine;
using BingoBrain.HotFix;
using FGUI.JTodo;
using FGUI.ACommon;
using DG.Tweening;
namespace BingoBrain
{
public class BasptUI : BaseUI
{
private BasptUICtrl ctrl;
private BasptModel model;
private com_todo ui;
private float time = 0;
public BasptUI(BasptUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BasptUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JTodo";
uiInfo.assetName = "com_todo";
uiInfo.layerType = UILayerType.Normal;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
uiInfo.isTickUpdate = true;
}
#region
public override void OnUpdate()
{
time += Time.deltaTime;
if (time > 1)
{
GameDispatcher.Instance.Dispatch(BingoInfo.UpdateTodoView);
time = 0;
}
}
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BasptModel) as BasptModel;
}
protected override void OnClose()
{
GameDispatcher.Instance.RemoveListener(BingoInfo.GetReward, SetMakeup);
}
protected override void OnBind()
{
ui = baseUI as com_todo;
}
protected override void OnOpenBefore(object args)
{
GameDispatcher.Instance.AddListener(BingoInfo.GetReward, SetMakeup);
if (!GameHelper.IsGiftSwitch())
{
ui.btn_cash.visible = false;
ui.btn_coin.visible = false;
ui.settings.visible=false;
}
else
{
(ui.btn_cash as com_102).gift.selectedIndex = 1;
}
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
}
InitView();
SetMakeup();
}
protected override void OnOpen(object args)
{
}
#endregion
void SetMakeup(object a = null)
{
com_102 cash = ui.btn_cash as com_102;
com_101 gold = ui.btn_coin as com_101;
DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency102, 0.5f,
value => { cash.title.text = value.ToString("0.00"); });
DOVirtual.Float(0, PreferencesMgr.Instance.Currency101, 0.5f,
value => { gold.title.text = ((int)value).ToString(); });
}
private void InitView()
{
// ui.list_todo.itemRenderer = OnTodoItemRenderer;
// ui.list_todo.numItems = 3;
initBtn();
ui.settings.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JThinkUI_Open);
});
}
private void initBtn()
{
FGUI.JTodo.btn_todo[] btn_arr = new FGUI.JTodo.btn_todo[] { ui.btn_0, ui.btn_1, ui.btn_2 };
for (int i = 0; i < btn_arr.Length; i++)
{
OnTodoItemRenderer(i, btn_arr[i]);
if (GameHelper.IsGiftSwitch()) btn_arr[i].gift.selectedIndex = 1;
}
}
private void OnTodoItemRenderer(int index, GObject item)
{
if (item is FGUI.JTodo.btn_todo todoItem)
{
todoItem.cont_type.selectedIndex = index;
todoItem.SetClick(() =>
{
switch (index)
{
case 0:
OnClickSignIn();
break;
case 1:
OnClickLuckyWheel();
break;
case 2:
OnClickDailyTask();
break;
}
});
todoItem.cont_red.selectedIndex = index switch
{
0 => IsCanSignIn() ? FGUI.JTodo.btn_todo.Red_red : FGUI.JTodo.btn_todo.Red_none,
1 => IsCanLuckyWheel() ? FGUI.JTodo.btn_todo.Red_red : FGUI.JTodo.btn_todo.Red_none,
2 => IsCanDailyTask() ? FGUI.JTodo.btn_todo.Red_red : FGUI.JTodo.btn_todo.Red_none,
_ => todoItem.cont_red.selectedIndex
};
}
}
private void OnClickSignIn()
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTodUI_Open);
}
private void OnClickLuckyWheel()
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.BingoToyUI_Open);
}
private void OnClickDailyTask()
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.MissionUI_Open);
}
private bool IsCanSignIn()
{
return GameHelper.IsCanSignInToday();
}
private bool IsCanLuckyWheel()
{
return GameHelper.GetNowTime() >= PreferencesMgr.Instance.NextOpenWheelStampTime;
}
internal bool IsCanDailyTask()
{
bool hasActiveMission = false;
for (int i = 0; i < PreferencesMgr.Instance.ActiveMissions.Count; i++)
{
if (!PreferencesMgr.Instance.ActiveMissions[i].IsReward && PreferencesMgr.Instance.ActiveMissions[i].Progress >= PreferencesMgr.Instance.ActiveMissions[i].MaxProgress)
{
hasActiveMission = true;
break;
}
}
return hasActiveMission;
}
public void OnRefreshView()
{
InitView();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9676b06dac0e4ae4b28ca99bdfed42ab
timeCreated: 1678955968
@@ -0,0 +1,79 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BasptUICtrl : BaseUICtrl
{
private BasptUI ui;
private BasptModel model;
private uint openUIMsg = SkinInfo.BasptUI_Open;
private uint closeUIMsg = SkinInfo.BasptUI_Close;
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BasptModel) as BasptModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BasptUI(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.Instance.AddListener(BingoInfo.UpdateTodoView, OnUpdateTodoView);
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
GameDispatcher.Instance.RemoveListener(BingoInfo.UpdateTodoView, OnUpdateTodoView);
}
#endregion
private void OnUpdateTodoView(object protoMsg)
{
ui?.OnRefreshView();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 491a2fe1f0a844678482b90c5afdde33
timeCreated: 1678955969
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0214f2a681f04edaab741e3fc091ac32
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoCardCtrl : BaseCtrl
{
public static BingoCardCtrl Instance { get; private set; }
private BingoCardModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7f71d12f4bda4537a06f0e76ed17c8ee
timeCreated: 1679888249
@@ -0,0 +1,43 @@
using BingoBrain.Core;
using System.Collections.Generic;
namespace BingoBrain
{
public class BingoCardModel : BaseModel
{
private List<int> weightLst = new();
private int[] weights;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
#region
protected override void OnReadData()
{
weightLst.Clear();
var vo = GameHelper.GetConfig<FlopModel>().GetDataList();
foreach (var item in vo)
{
weightLst.Add(item.weight);
}
weights = weightLst.ToArray();
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4607a35d6b564eb49e0623ec876fc963
timeCreated: 1679888249
@@ -0,0 +1,362 @@
using FairyGUI;
using DG.Tweening;
using UnityEngine;
using BingoBrain.Core;
using BingoBrain.HotFix;
using FGUI.JBingoPlay;
using System.Collections.Generic;
namespace BingoBrain
{
public class BingoCardUI : BaseUI
{
private BingoCardUICtrl ctrl;
private BingoCardModel model;
private com_playcard ui;
private List<btn_card> btn_Cards = new();
private List<btn_card> btn_CardLst = new();
private string tapRewardStr;
public int ClickNum;
public int MaxClickNum = 3;
private bool canClick;
private Queue<Tween> tweenerQueue = new();
private List<Vector2> posLst = new();
public BingoCardUI(BingoCardUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoCardUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JBingoPlay";
uiInfo.assetName = "com_playcard";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedUIMask = true;
}
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoCardModel) as BingoCardModel;
}
protected override void OnClose()
{
ui?.FadeOut().OnComplete(() =>
{
ui?.fx_show.Stop();
OnClearTween();
});
}
protected override void OnBind()
{
ui = baseUI as com_playcard;
btn_Cards.Add(ui.btn_card1);
btn_Cards.Add(ui.btn_card2);
btn_Cards.Add(ui.btn_card3);
btn_Cards.Add(ui.btn_card4);
btn_Cards.Add(ui.btn_card5);
btn_Cards.Add(ui.btn_card6);
btn_Cards.Add(ui.btn_card7);
btn_Cards.Add(ui.btn_card8);
btn_Cards.Add(ui.btn_card9);
ui.fairyBatching = false;
foreach (var btnCard in btn_Cards)
{
posLst.Add(btnCard.position);
}
}
protected override void OnOpenBefore(object args)
{
InitView();
}
private void InitView()
{
ui.com_prize.list.touchable = false;
flop_RewardVOLst.Clear();
var dataList = GameHelper.GetConfig<FlopModel>().GetDataList();
foreach (var item in dataList)
{
flop_RewardVOLst.Add(item);
}
Audio.Instance.PlayDynamicEffect("pop_open");
ui.cont_state.selectedIndex = com_playcard.State_choose;
foreach (var item in btn_Cards)
{
item.onClick.Set(OnClickCard);
}
ClickNum = 0;
tapRewardStr = ui.text_Num.text;
ui.text_Num.text = string.Format(tapRewardStr, ClickNum + "/" + MaxClickNum);
ui.com_prize.list.SetVirtualAndLoop();
ui.com_prize.list.itemRenderer = RendererTop;
ui.com_prize.list.numItems = 5;
ui.btn_collect.onClick.Set(ClickContinueBtn);
ui.text_no.onClick.Set(ClickContinueBtn);
ui.btn_video.onClick.Set(ClickVideoBtn);
var tween = DOVirtual.Float(0, 0.745f, 20, e => { ui.com_prize.list.scrollPane.percX = e; }).SetLoops(-1);
tweenerQueue.Enqueue(tween);
}
private void RendererTop(int index, GObject item)
{
var com_Prizeitem = (com_prizeitem)item;
var val = index % 3;
switch (val)
{
case 0:
EyesHarmony.GetItem(101, t => { com_Prizeitem.loader_item.texture = t; });
break;
case 1:
EyesHarmony.GetItem(102, t => { com_Prizeitem.loader_item.texture = t; });
break;
case 2:
EyesHarmony.GetItem(104, t => { com_Prizeitem.loader_item.texture = t; });
break;
default:
com_Prizeitem.loader_item.texture = com_Prizeitem.loader_item.texture;
break;
}
}
protected override void OnOpen(object args)
{
ui?.FadeIn();
GameHelper.PlayFGUIFx(ui?.fx_show);
DOVirtual.DelayedCall(ui.fx_show.totalDuration, () =>
{
ui.fx_show.Stop();
Debug.Log("动画播放完成");
canClick = true;
for (var index = 0; index < btn_Cards.Count; index++)
{
var btnCard = btn_Cards[index];
btnCard.scale = Vector2.one;
btnCard.visible = true;
btnCard.position = posLst[index];
}
});
}
private void ClickVideoBtn(EventContext context)
{
if (!canClick)
{
return;
}
GameHelper.GetVideo("reward_extraFlip", isSuccess =>
{
// if (isSuccess)
{
var adwardModel = GameHelper.GetConfig<AdRewardModel>();
MaxClickNum = Mathf.Clamp(MaxClickNum + adwardModel.GetData("reward_extraFlip").rewardAmount,
0, btn_Cards.Count);
ui.cont_state.selectedIndex = com_playcard.State_choose;
foreach (var item in btn_Cards)
{
item.onClick.Set(OnClickCard);
}
ui.text_Num.text = string.Format(tapRewardStr, ClickNum + "/" + MaxClickNum);
}
});
}
private void OnClickCard(EventContext context)
{
if (!canClick)
{
return;
}
var btn = context.sender as btn_card;
if (btn.cont_button.selectedIndex == btn_card.Button_front)
{
return;
}
canClick = false;
Audio.Instance.PlayDynamicEffect("flip");
ClickNum++;
ui.AddChild(btn);
btn_CardLst.Add(btn);
btn.onClick.Clear();
btn.cont_button.selectedIndex = btn_card.Button_front;
SetCardData(btn);
ui.text_Num.text = string.Format(tapRewardStr, ClickNum + "/" + MaxClickNum);
if (ClickNum >= MaxClickNum)
{
// 全部翻完
foreach (var item in btn_Cards)
{
item.onClick.Clear();
}
if (MaxClickNum >= btn_Cards.Count)
{
ui.cont_state.selectedIndex = com_playcard.State_collect;
}
else
{
ui.cont_state.selectedIndex = com_playcard.State_video;
var tw = GameHelper.DelayedShowGObject(this, ui.text_no);
tweenerQueue.Enqueue(tw);
}
}
}
private void ClickContinueBtn()
{
if (!canClick)
{
return;
}
OpenAll();
}
private List<Flop> flop_RewardVOLst = new();
private Flop GetRananVO()
{
if (flop_RewardVOLst.Count <= 0)
{
return null;
}
var index = Random.Range(0, flop_RewardVOLst.Count);
var val = flop_RewardVOLst[index];
flop_RewardVOLst.RemoveAt(index);
if (!GameHelper.IsGiftSwitch() && val.itemID == 122)
{
val = GameHelper.GetConfig<FlopModel>().GetData(6);
}
return val;
}
private void OpenAll()
{
// 表现
ui.cont_state.selectedIndex = com_playcard.State_none;
float time = 0;
var sum = 0;
foreach (var item in btn_Cards)
{
if (item.cont_button.selectedIndex == btn_card.Button_front)
{
continue;
}
var delay = time;
var item1 = item;
var tw = DOVirtual.DelayedCall(delay, () =>
{
item1.cont_button.selectedIndex = btn_card.Button_front;
var vo = GetRananVO();
EyesHarmony.GetItem(vo.itemID, tx => { item1.loader_reward.texture = tx; });
item1.text_num.text = vo.itemID == 102
? $"{GameHelper.Get102Str((decimal)vo.quantity[0])}"
: GameHelper.GetNoDecimalUnitStr(vo.quantity[0]);
});
tweenerQueue.Enqueue(tw);
time += 0.1f;
sum += 1;
}
var tew = DOVirtual.DelayedCall(sum * 0.25f,
() => { uiCtrlDispatcher.Dispatch(SkinInfo.BingoCardUI_Close); });
tweenerQueue.Enqueue(tew);
}
private void SetCardData(btn_card btn)
{
var vo = GetRananVO();
var id = vo.itemID;
var val = vo.quantity[GameHelper.GetDynamicIndex(id)];
EyesHarmony.GetItem(id, tx => { btn.loader_reward.texture = tx; });
btn.text_num.text = id == 102 ? GameHelper.Get102Str((decimal)val) : GameHelper.GetNoDecimalUnitStr(val);
var startPosition = btn.position + (Vector3)btn.size / 2;
if (vo.isMulti)
{
var tw = DOVirtual.DelayedCall(0.7f, () =>
{
GameHelper.GetRewardExtra(id, (decimal)val, vo.cont_index, isCompleted =>
{
var tw1 = DOVirtual.DelayedCall(0.3f, () => { canClick = true; });
tweenerQueue.Enqueue(tw1);
}, startPosition);
});
tweenerQueue.Enqueue(tw);
}
else
{
if (id == 102)
{
var rewardData = new RewardData();
var rewardSingleData = new Goda(102, (decimal)val, RewardOrigin.Slot)
{
startPosition = startPosition
};
rewardData.AddReward(rewardSingleData);
rewardData.AddCompleted(isSuccess =>
{
var tw1 = DOVirtual.DelayedCall(0.3f, () => { canClick = true; });
tweenerQueue.Enqueue(tw1);
});
rewardData.condition = GameHelper.IsCanGuide() ? RewardCondition.None : RewardCondition.AD;
rewardData.displayType =
RewardDisplayType.Dialog | RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
GameDispatcher.Instance.Dispatch(BingoInfo.GetReward, rewardData);
}
else
{
GameHelper.GetRewardOnly1(id, (decimal)val, RewardOrigin.PlayCard, isSuccess =>
{
var tw1 = DOVirtual.DelayedCall(0.3f, () => { canClick = true; });
tweenerQueue.Enqueue(tw1);
}, startPosition);
}
}
}
private void OnClearTween()
{
while (tweenerQueue.Count > 0)
{
var tw = tweenerQueue.Dequeue();
if (tw is { active: true })
{
tw.Kill();
}
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bf13514e548d43fdb6df19cae799f9ee
timeCreated: 1679888249
@@ -0,0 +1,71 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoCardUICtrl : BaseUICtrl
{
private BingoCardUI ui;
private BingoCardModel model;
private uint openUIMsg = SkinInfo.BingoCardUI_Open;
private uint closeUIMsg = SkinInfo.BingoCardUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BingoCardUI(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: 7875be205a764ef885ecbbe9ce986b99
timeCreated: 1679888249
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 38aed8d8feea4d05b845d52c9063dc59
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoEndCtrl : BaseCtrl
{
public static BingoEndCtrl Instance { get; private set; }
private BingoEndModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5c38f4d8cae348859d6d825d5bb30382
timeCreated: 1679912030
@@ -0,0 +1,23 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoEndModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 283e9671d20f476ab0ba7a7b593039ae
timeCreated: 1679912030
@@ -0,0 +1,126 @@
using System;
using FairyGUI;
using Spine.Unity;
using BingoBrain.Core;
using UnityEngine;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoEndUI : BaseUI
{
private BingoEndUICtrl ctrl;
private BingoEndModel model;
private FGUI.JBingoPlay.com_end ui;
private Action closeCb;
public BingoEndUI(BingoEndUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoEndUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JBingoPlay";
uiInfo.assetName = "com_end";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = true;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
ui?.FadeOut();
closeCb?.Invoke();
}
protected override void OnBind()
{
ui = baseUI as FGUI.JBingoPlay.com_end;
}
protected override void OnOpenBefore(object args)
{
FX.Instance.GetFx<SkeletonAnimation>(Fx_Type.spine_reward, sk =>
{
var skeletal = sk;
var goWrapper = new GoWrapper(skeletal.gameObject);
ui.com_endPop.gp_fx.SetNativeObject(goWrapper);
skeletal.transform.localScale = Vector3.one * 110;
skeletal.state.SetAnimation(0, "animation", true);
closeCb += () =>
{
goWrapper.wrapTarget = null;
ui.com_endPop.gp_fx.SetNativeObject(null);
FX.Instance.RecFx(Fx_Type.spine_reward, skeletal);
};
});
}
protected override void OnOpen(object args)
{
ui?.FadeIn();
InitView();
}
private void PlayAgain()
{
if (PreferencesMgr.Instance.CardBoardSum >= BingoCell.CardBoardCount)
{
PreferencesMgr.Instance.CardBoardSum -= BingoCell.CardBoardCount;
CtrlCloseUI();
GameDispatcher.Instance.Dispatch(BingoInfo.EndBingoGame, false);
GameDispatcher.Instance.Dispatch(BingoInfo.StartBingoGame);
}
else
{
uiCtrlDispatcher.Dispatch(SkinInfo.MoreCardUI_Open);
}
}
private void BackHome()
{
CtrlCloseUI();
GameDispatcher.Instance.Dispatch(BingoInfo.EndBingoGame, true);
GameHelper.ShowInterstitial("interstitial_endgameAd");
}
#endregion
private void InitView()
{
if (BingoCell.isFirstGame)
{
PreferencesMgr.Instance.CardBoardIndex = 1;
}
else
{
if (PreferencesMgr.Instance.IsSecondEndShow)
{
PreferencesMgr.Instance.IsSecondEndShow = false;
}
}
if (GameHelper.IsGiftSwitch()) ui.com_endPop.gift.selectedIndex = 1;
ui.com_endPop.cont_giftSwitch.selectedIndex = GameHelper.IsGiftSwitch() ? 0 : 1;
ui.btn_home.onClick.Set(BackHome);
ui.btn_playagain.onClick.Set(PlayAgain);
ui.com_endPop.text_coin.text = GameHelper.GetItemSum(101, BingoCell.GetCoinSum);
ui.com_endPop.text_cash.text = GameHelper.GetItemSum(102, BingoCell.GetCashSum);
ui.btn_playagain.text_cardnum.text =
string.Format(ui.btn_playagain.text_cardnum.text, BingoCell.CardBoardCount);
Audio.Instance.PlayDynamicEffect("game_win");
GameHelper.SetGObject("fourth", ui.btn_playagain);
GameHelper.SetGuidePos("fourth",
ui.btn_playagain.position + new Vector3(ui.btn_playagain.size.x, ui.btn_playagain.size.y) / 2);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2bbc285496c741938b6cba7f47393cb9
timeCreated: 1679912030
@@ -0,0 +1,77 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoEndUICtrl : BaseUICtrl
{
private BingoEndUI ui;
private BingoEndModel model;
private uint openUIMsg = SkinInfo.BingoEndUI_Open;
private uint closeUIMsg = SkinInfo.BingoEndUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (!BingoCell.IsInGame)
{
return;
}
if (ui == null)
{
ui = new BingoEndUI(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: 1f0b994980ab40c3929f7ce573e10357
timeCreated: 1679912030
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2e5b01f7b5b04b2988e364df42e7c5f1
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoHallCtrl : BaseCtrl
{
public static BingoHallCtrl Instance { get; private set; }
private BingoHallModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: df5afaa02bf6dcd4ab87134fe57e2ef6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,184 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoHallModel : BaseModel
{
public decimal show101;
public decimal show102;
public event Action RefreshUIEvent;
public bool IsAni { get; set; }
private void RefreshData(object obj)
{
if (!IsAni)
{
show101 = PreferencesMgr.Instance.Currency101;
show102 = PreferencesMgr.Instance.Currency102;
RefreshUI();
}
}
public string NextCardBoardTimeStr
{
get
{
long sum = PreferencesMgr.Instance.NextRecoveryTime - GameHelper.GetNowTime();
if (sum <= 0)
{
return string.Empty;
}
return GameHelper.GetNoDecimalUnitStr((int)sum);
}
}
public int CardBoardCountIndex
{
get { return PreferencesMgr.Instance.CardBoardIndex; }
set { PreferencesMgr.Instance.CardBoardIndex = value; }
}
/// <summary>
/// 最大卡牌数量
/// </summary>
public int MaxCardBoardSum { get; private set; }
/// <summary>
/// 恢复一张卡板的时间
/// </summary>
public int CardBoardRecoveryTime { get; private set; }
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
#region
protected override void OnReadData()
{
MaxCardBoardSum = GameHelper.GetCommonModel().MaxCardBoardSum[0];
CardBoardRecoveryTime = GameHelper.GetCommonModel().CardBoardRecoveryTime;
show101 = PreferencesMgr.Instance.Currency101;
show102 = PreferencesMgr.Instance.Currency102;
}
#endregion
#region
protected override void AddListener()
{
CtrlDispatcher.Instance.AddListener(CtrlMsg.Game_Start, CalculateOfflineTime);
DataDispatcher.Instance.AddListener(PreferencesMsg.currency101, RefreshData);
DataDispatcher.Instance.AddListener(PreferencesMsg.currency102, RefreshData);
PreferencesDispatcher<int>.Instance.AddListener(PreferencesMsg.cardBoardSum, ChangeRecoveryTime);
Hall.Instance.UpdateSecondEvent += CheckCarBoard;
}
protected override void RemoveListener()
{
DataDispatcher.Instance.RemoveListener(PreferencesMsg.currency101, RefreshData);
DataDispatcher.Instance.RemoveListener(PreferencesMsg.currency102, RefreshData);
CtrlDispatcher.Instance.RemoveListener(CtrlMsg.Game_Start, CalculateOfflineTime);
PreferencesDispatcher<int>.Instance.RemoveListener(PreferencesMsg.cardBoardSum, ChangeRecoveryTime);
Hall.Instance.UpdateSecondEvent -= CheckCarBoard;
}
#endregion
/// <summary>
/// 改变卡板恢复时间
/// </summary>
private void ChangeRecoveryTime(object o)
{
ExiteValue<int> exiteValue = o as ExiteValue<int>;
if (exiteValue.oldValue >= MaxCardBoardSum)
{
if (exiteValue.newValue < MaxCardBoardSum)
{
PreferencesMgr.Instance.NextRecoveryTime =
GameHelper.GetNowTime() + CardBoardRecoveryTime;
}
}
}
/// <summary>
/// 在线恢复
/// </summary>
private void CheckCarBoard()
{
if (PreferencesMgr.Instance.CardBoardSum >= MaxCardBoardSum)
{
return;
}
if (GameHelper.GetNowTime() >= PreferencesMgr.Instance.NextRecoveryTime)
{
int val = Mathf.Clamp(PreferencesMgr.Instance.CardBoardSum + 1, 0, MaxCardBoardSum);
PreferencesMgr.Instance.CardBoardSum = val;
PreferencesMgr.Instance.NextRecoveryTime =
GameHelper.GetNowTime() + CardBoardRecoveryTime;
}
}
/// <summary>
/// 计算离线卡牌增加
/// </summary>
private void CalculateOfflineTime(object o)
{
if (PreferencesMgr.Instance.CardBoardSum >= MaxCardBoardSum)
{
return;
}
Debug.LogFormat("计算离线时间搓,当前时间搓{0},生成下一张卡牌的时间搓{1}", DateTimeBoardk.Instance.GetServerCurrTimestamp(),
PreferencesMgr.Instance.NextRecoveryTime);
if (GameHelper.GetNowTime() >= PreferencesMgr.Instance.NextRecoveryTime)
{
int val =
(int)(GameHelper.GetNowTime() - PreferencesMgr.Instance.NextRecoveryTime);
int sum1 = val / CardBoardRecoveryTime + 1;
int sum2 = val % CardBoardRecoveryTime;
int sum3 = Mathf.Clamp(sum1 + PreferencesMgr.Instance.CardBoardSum, 0, MaxCardBoardSum);
if (sum3 >= MaxCardBoardSum)
{
PreferencesMgr.Instance.NextRecoveryTime =
GameHelper.GetNowTime() + CardBoardRecoveryTime;
}
else
{
PreferencesMgr.Instance.NextRecoveryTime =
GameHelper.GetNowTime() + CardBoardRecoveryTime - sum2;
}
PreferencesMgr.Instance.CardBoardSum = sum3;
}
}
public void RefreshUI()
{
RefreshUIEvent?.Invoke();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1f3b8441e0f8eeb4ba2957e4ac0f17ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,560 @@
using Spine;
using System;
using FairyGUI;
using DG.Tweening;
using UnityEngine;
using Spine.Unity;
using BingoBrain.Core;
using BingoBrain.HotFix;
using FGUI.JMain;
using System.Collections.Generic;
using Random = UnityEngine.Random;
using FGUI.ACommon;
using System.Linq;
using Newtonsoft.Json;
namespace BingoBrain
{
public class BingoHallUI : BaseUI
{
private BingoHallUICtrl ctrl;
private BingoHallModel model;
public com_main ui;
private float moveTime = 3;
private bool isLeft = true;
private Tween waitTween;
private string RadioStr = "[color=#00FF00]{0} [/color]sent to [color=#FF0000]{1}[/color]";
private Queue<GTweener> gtweenerQueue = new();
private Queue<Tween> tweenerQueue = new();
bool IsBallonCD => GameHelper.GetNowTime() < PreferencesMgr.Instance.BallonCdTime;
public BingoHallUI(BingoHallUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoHallUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JMain";
uiInfo.assetName = "com_main";
uiInfo.layerType = UILayerType.Normal;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
}
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoHallModel) as BingoHallModel;
}
protected override void OnClose()
{
OnClearTween();
Hall.Instance.UpdateSecondEvent -= UpdateSecond;
}
protected override void OnBind()
{
ui = baseUI as com_main;
}
protected override void OnOpenBefore(object args)
{
InitView();
if (!GameHelper.IsGiftSwitch() && (ConfigSystem.GetConfig<CommonModel>().WVswitch == 1))
{
ui.btn_h5.visible = true;
ui.btn_h5.GetChild("number_text").visible=false;
}
ui.btn_h5.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.H5UI_Open);
});
}
protected override void OnOpen(object args)
{
}
#endregion
#region
protected override void AddListener()
{
Hall.Instance.AddChangeGiftSwitch(InitView);
PreferencesDispatcher<int>.Instance.AddListener(PreferencesMsg.cardBoardSum, CardBoardSumChange);
GameDispatcher.Instance.AddListener(BingoInfo.RefreshMakeupData, SetMakeup);
}
protected override void RemoveListener()
{
Hall.Instance.RemoveChangeGiftSwitch(InitView);
PreferencesDispatcher<int>.Instance.RemoveListener(PreferencesMsg.cardBoardSum, CardBoardSumChange);
GameDispatcher.Instance.RemoveListener(BingoInfo.RefreshMakeupData, SetMakeup);
}
#endregion
private void InitView()
{
if (GameHelper.IsGiftSwitch())
{
ui.gift.selectedIndex = 1;
(ui.btn_ballon as btn_balloon).gift.selectedIndex = 1;
};
#if !UNITY_EDITOR
ui.btn_admin.visible=false;
#endif
if (Screen.safeArea.y != 0)
{//刘海屏
ui.com_cards.y += Screen.safeArea.y;
}
InitSpine();
ui.btn_play.SetClick(OnClickPlay);
ui.com_cardnum.cont_state.onChanged.Set(() => { OnCardNumChange(null); });
ui.com_cardnum.btn_add.SetClick(OnBtnAddClick);
ui.com_cardnum.btn_add.cont_button.selectedIndex = PlayerPrefs.GetInt("FirstGame", 0) == 1
? ui.com_cardnum.btn_add._Button_light
: ui.com_cardnum.btn_add._Button_dark;
ui.com_cardnum.btn_add.touchable = PlayerPrefs.GetInt("FirstGame", 0) == 1;
ui.com_cardnum.btn_minus.SetClick(OnBtnMinusClick);
OnCardNumChange(null);
ui.com_cardnum.cont_state.selectedIndex = model.CardBoardCountIndex;
ui.com_cardplay.cont_text.selectedIndex = model.CardBoardCountIndex;
ui.btn_ballon.visible = !IsBallonCD;
ui.btn_ballon.SetClick(OnClickBalloon);
ui.btn_ballon.sortingOrder = 100;
MoveToOtherSide();
Hall.Instance.UpdateSecondEvent += UpdateSecond;
CardBoardSumChange(null);
UpdateNextCardBoardTime();
ui.com_cards.SetClick(() =>
{
if (PreferencesMgr.Instance.CardBoardSum == 0)
{
uiCtrlDispatcher.Dispatch(SkinInfo.MoreCardUI_Open);
}
});
ui.fairyBatching = false;
SetMakeup();
ui.btn_admin.SetClick(() =>
{
MakeupTaskData makeupTaskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
makeupTaskData.videoCount = 999999;
PreferencesMgr.Instance.MakeupTaskH5Time = 99999;
PreferencesMgr.Instance.Currency102 = 99999;
PreferencesMgr.Instance.Currency101 = 99999999;
GameDispatcher.Instance.Dispatch(BingoInfo.RefreshMakeupData);
makeupTaskData = PreferencesMgr.Instance.CoinMakeupTaskHistory.Last();
makeupTaskData.videoCount = 99999;
PreferencesMgr.Instance.CoinMakeupTaskH5Time = 99999;
});
ui.btn_set.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JThinkUI_Open);
});
ui.btn_question.SetClick(() =>
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.FaqUIUI_Open);
});
}
private void UpdateNextCardBoardTime()
{
if (ui.com_cards.text_time.visible)
{
ui.com_cards.text_time.text = $"New card in {model.NextCardBoardTimeStr}s";
}
}
private void CardBoardSumChange(object obj)
{
if (PreferencesMgr.Instance.CardBoardSum >= model.MaxCardBoardSum)
{
ui.com_cards.cont_cardleft.selectedIndex = com_playnum.Cardleft_full;
}
else if (PreferencesMgr.Instance.CardBoardSum == 0)
{
ui.com_cards.cont_cardleft.selectedIndex = com_playnum.Cardleft_none;
}
else
{
ui.com_cards.cont_cardleft.selectedIndex = com_playnum.Cardleft_left;
}
ui.com_cards.text_num.text = GameHelper.GetNoDecimalUnitStr(PreferencesMgr.Instance.CardBoardSum);
}
private bool isMoveFinish = true;
private Vector2 StartPos = new(9, 647);
private Vector2 FinalPos = new(925, 539);
void MoveToOtherSide()
{
if (waitTween != null)
{
return;
}
isLeft = !isLeft;
if (!ui.btn_ballon.visible)
{
return;
}
if (!isMoveFinish)
{
return;
}
var targetPos = isLeft ? StartPos : FinalPos;
float offset = 300;
targetPos.y = Random.Range(BingoCell.CenterUIPos.y - offset, BingoCell.CenterUIPos.y + offset);
isMoveFinish = false;
var tw = ui.btn_ballon.TweenMove(targetPos, moveTime).OnComplete(() =>
{
isMoveFinish = true;
ui.btn_ballon.InvalidateBatchingState();
float waitTime = Random.Range(5, 11);
waitTween = DOVirtual.DelayedCall(waitTime, () =>
{
waitTween = null;
MoveToOtherSide();
});
tweenerQueue.Enqueue(waitTween);
});
gtweenerQueue.Enqueue(tw);
}
private void UpdateSecond()
{
if (!Hall.Instance.IsGaming())
{
if (ui != null && ui.btn_ballon != null)
{
if (ui.btn_ballon.visible != !IsBallonCD)
{
ui.btn_ballon.visible = !IsBallonCD;
// 开始移动
if (ui.btn_ballon.visible)
{
MoveToOtherSide();
}
}
}
}
UpdateNextCardBoardTime();
}
private void OnClickBalloon()
{
if (BingoCell.isProcedure || BingoCell.IsGuiding)
{
return;
}
Audio.Instance.PlayDynamicEffect("button");
GameHelper.GetVideo("reward_flyballoon", isSuccess =>
{
if (isSuccess)
{
ui.btn_ballon.touchable = false;
var rewardType = GameHelper.GetCommonModel().ballonRewardType[0];
double rewardCount = 0;
if (rewardType == 102)
{
rewardCount = GameHelper.GetDynamicReward(102, GameHelper.GetCommonModel().ballonReward102);
}
ui.btn_ballon.visible = false;
PreferencesMgr.Instance.BallonCdTime =
(int)(GameHelper.GetNowTime() + GameHelper.GetCommonModel().ballonCD);
GameHelper.GetRewardOnly(rewardType, (decimal)rewardCount, RewardOrigin.Ballon,
isSuccess =>
{
ui.btn_ballon.touchable = true;
GameDispatcher.Instance.Dispatch(BingoInfo.RefreshMakeupData);
}, ui.btn_ballon, GameHelper.IsGiftSwitch() ? ui.makeup.cash_text : null);
}
});
}
private void OnBtnMinusClick()
{
model.CardBoardCountIndex--;
ui.com_cardnum.cont_state.selectedIndex = model.CardBoardCountIndex;
ui.com_cardplay.cont_text.selectedIndex = model.CardBoardCountIndex;
var animName = model.CardBoardCountIndex switch
{
0 => "2_1",
1 => "4_2",
_ => ""
};
NAAVsa.PlayAnim(cardSpine, animName);
}
private void OnBtnAddClick()
{
model.CardBoardCountIndex++;
ui.com_cardnum.cont_state.selectedIndex = model.CardBoardCountIndex;
ui.com_cardplay.cont_text.selectedIndex = model.CardBoardCountIndex;
var animName = model.CardBoardCountIndex switch
{
1 => "1_2",
2 => "2_4",
_ => ""
};
NAAVsa.PlayAnim(cardSpine, animName);
}
private void OnCardNumChange(EventContext context)
{
switch (model.CardBoardCountIndex)
{
case 0:
ui.com_cardnum.btn_minus.cont_button.selectedIndex = ui.com_cardnum.btn_minus._Button_dark;
ui.com_cardnum.btn_add.cont_button.selectedIndex = ui.com_cardnum.btn_add._Button_light;
ui.com_cardnum.btn_minus.touchable = false;
ui.com_cardnum.btn_add.touchable = true;
break;
case 2:
ui.com_cardnum.btn_minus.cont_button.selectedIndex = ui.com_cardnum.btn_minus._Button_light;
ui.com_cardnum.btn_add.cont_button.selectedIndex = ui.com_cardnum.btn_add._Button_dark;
ui.com_cardnum.btn_minus.touchable = true;
ui.com_cardnum.btn_add.touchable = false;
break;
default:
ui.com_cardnum.btn_minus.cont_button.selectedIndex = ui.com_cardnum.btn_minus._Button_light;
ui.com_cardnum.btn_add.cont_button.selectedIndex = ui.com_cardnum.btn_add._Button_light;
ui.com_cardnum.btn_minus.touchable = true;
ui.com_cardnum.btn_add.touchable = true;
break;
}
}
private SkeletonAnimation cardSpine;
private Action CloseCb;
private void InitSpine()
{
if (cardSpine != null)
{
return;
}
if (GameHelper.IsGiftSwitch())
{
FX.Instance.SetFx<SkeletonAnimation>(ui.gp_fx, Fx_Type.spine_choice_card_b, sk =>
{
cardSpine = sk;
NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
OnChangeCardFinish(null);
}, CloseCb);
}
else
{
FX.Instance.SetFx<SkeletonAnimation>(ui.gp_fx, Fx_Type.spine_choice_card, sk =>
{
cardSpine = sk;
NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
OnChangeCardFinish(null);
}, CloseCb);
}
}
private void OnChangeCardFinish(TrackEntry trackEntry)
{
if (trackEntry != null && trackEntry.Animation.Name.Contains("animation"))
{
return;
}
var idleName = model.CardBoardCountIndex switch
{
0 => "animation1",
1 => "animation2",
_ => "animation4"
};
NAAVsa.PlayAnim(cardSpine, idleName, true);
}
private void OnClickPlay()
{
if (PreferencesMgr.Instance.CardBoardSum >= BingoCell.CardBoardCount)
{
PreferencesMgr.Instance.CardBoardSum -= BingoCell.CardBoardCount;
ui.com_cards.text_fx.text = $"-{BingoCell.CardBoardCount}";
ui.touchable = false;
ui.com_cards.fx_num.Play();
DOVirtual.DelayedCall(ui.com_cards.fx_num.totalDuration / 2, () =>
{
uiCtrlDispatcher.Dispatch(SkinInfo.SmailUI_Close);
GameDispatcher.Instance.Dispatch(BingoInfo.StartBingoGame);
});
}
else
{
uiCtrlDispatcher.Dispatch(SkinInfo.MoreCardUI_Open);
}
}
private void OnClearTween()
{
while (gtweenerQueue.Count > 0)
{
var tw = gtweenerQueue.Dequeue();
tw?.Kill();
}
while (tweenerQueue.Count > 0)
{
var tw = tweenerQueue.Dequeue();
if (tw is { active: true })
{
tw.Kill();
}
}
}
void SetMakeup(object a = null)
{
if(!GameHelper.IsGiftSwitch()) return;
// var com_box = ui.com_box;
// com_box.cont_white.selectedIndex =
// GameHelper.IsGiftSwitch() ? com_box._White_none : com_box._White_white;
// if (!GameHelper.IsGiftSwitch())
// {
// ui.text_uid.SetVar("uid", loginModel.uid.ToString()).FlushVars();
// }
// GameHelper.SetSelfCountryFlag(ui.com_box.btn_menu.loader_flag);
// SetAvatar();
// SetName();
// com_box.text_num.text = GameHelper.Get101Str(PreferencesMgr.Instance.Currency101);
// DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency101, 1,
// value => { com_box.text_num.text = GameHelper.Get101Str((decimal)value); });
if (GameHelper.IsGiftSwitch())
{
var makeupTaskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
Debug.Log(PreferencesMgr.Instance.MakeupTaskHistory.Count);
Debug.Log(JsonConvert.SerializeObject(makeupTaskData));
Debug.Log(ConfigSystem.GetConfig<MakeupModel>().GetCount());
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<MakeupModel>()));
makeup vo = null;
foreach (makeup item in ConfigSystem.GetConfig<MakeupModel>().dataList)
{
Debug.Log(JsonConvert.SerializeObject(item));
if (item.id == makeupTaskData.tableId) vo = item;
}
// Debug.Log(ConfigSystem.GetConfig<MakeupModel>().GetData(0));
// Debug.Log(ConfigSystem.GetConfig<MakeupModel>().GetData(1));
// Debug.Log(ConfigSystem.GetConfig<MakeupModel>().GetData(2));
// if (vo == null)
// {
// return;
// }
DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency102, 1,
value => { ui.makeup.cash_text.text = value.ToString("0.00"); });
ui.makeup.cash_progress_text.text = PreferencesMgr.Instance.Currency102 + "/" + vo.item_need;
ui.makeup.cash_progress.value = ((float)PreferencesMgr.Instance.Currency102 * 100) / vo.item_need;
// var leftCash = (double)Math.Max(vo.item_need - PreferencesMgr.Instance.Currency101, 0);
// com_box.text_more.SetVar("left", GameHelper.Get101Str((decimal)leftCash)).FlushVars();
// com_box.pb_num.max = vo.item_need;
// com_box.pb_num.value = vo.item_need - leftCash;
// pbTxt.text =
// $"{GameHelper.Get101Str((decimal)(vo.item_need - leftCash))}/{GameHelper.Get101Str((decimal)com_box.pb_num.max)}";
ui.makeup.btn_cash.SetClick(() =>
{
Debug.Log("999999999999999");
// if (GameHelper.CanGuide() && !GuideCtrl.Instance.IsFinishGuide(1))
// {
// GuideCtrl.Instance.Dispatch("ClickButton");
// ui.com_box.finger_place.visible = false;
// }
uiCtrlDispatcher.Dispatch(SkinInfo.MakeupConfirmUI_Open, makeupTaskData);
});
}
{
if (PreferencesMgr.Instance.CoinMakeupTaskHistory.Count == 0)
{
BingoDataSystem.CheckCoinMakeupTaskData();
//PreferencesMgr.Instance.MakeupTaskHistory.Add(new MakeupTaskData());
//Debug.Log(PreferencesMgr.Instance.MakeupTaskHistory.Count);
}
var makeupTaskData = PreferencesMgr.Instance.CoinMakeupTaskHistory.Last();
var vo = ConfigSystem.GetConfig<CardRedeemNewModel>().dataList
.FirstOrDefault(cardNew => cardNew.id == makeupTaskData.tableId);
Debug.Log(JsonConvert.SerializeObject(vo));
DOVirtual.Float(0, PreferencesMgr.Instance.Currency101, 1,
value => { ui.makeup.gold_text.text = ((int)value).ToString(); });
ui.makeup.gold_progress_text.text = PreferencesMgr.Instance.Currency101 + "/" + vo.item_need;
ui.makeup.gold_progress.value = ((float)PreferencesMgr.Instance.Currency101 * 100) / vo.item_need;
Debug.Log(((float)PreferencesMgr.Instance.Currency101) / vo.item_need);
ui.makeup.coin_cash.text = "$" + vo.redeem_num;
ui.makeup.btn_goldout.SetClick(() =>
{
Debug.Log(PreferencesMgr.Instance.Currency101);
Debug.Log(vo.item_need);
if (makeupTaskData.status == MakeupTaskStatus.None)
{
if (PreferencesMgr.Instance.Currency101 >= vo.item_need)
{
uiCtrlDispatcher.Dispatch(SkinInfo.MakeupConfirmUI_Open, makeupTaskData);
}
else
{
GameHelper.ShowTips("Not enough", true);
}
}
else
{
uiCtrlDispatcher.Dispatch(SkinInfo.MakeupConfirmUI_Open, makeupTaskData);
}
});
}
(ui.btn_ballon as btn_balloon).cash_text.text = GameHelper.GetDynamicReward(102, GameHelper.GetCommonModel().ballonReward102).ToString("0.00");
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dc45cb6ebb3195e4ebe47f63ef45e1b0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,72 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoHallUICtrl : BaseUICtrl
{
private BingoHallUI ui;
private BingoHallModel model;
private uint openUIMsg = SkinInfo.BingoHallUI_Open;
private uint closeUIMsg = SkinInfo.BingoHallUI_Close;
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoHallModel) as BingoHallModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BingoHallUI(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,11 @@
fileFormatVersion: 2
guid: d7096e09f4f1f564884e1183740686ed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7b13038e5f974109a429960ef3bda03c
timeCreated: 1699933728
@@ -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
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0180b316f7ee4de9bff3a3f0d32af1bd
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoStartCtrl : BaseCtrl
{
public static BingoStartCtrl Instance { get; private set; }
private BingoStartModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 92f961e174bc4386bb3ba83161d8f094
timeCreated: 1679367555
@@ -0,0 +1,26 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoStartModel : BaseModel
{
public decimal show101;
public decimal show102;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ab3110adb8be453a86e9bd7a2b6b8106
timeCreated: 1679367555
@@ -0,0 +1,736 @@
using System;
using FairyGUI;
using UnityEngine;
using BingoBrain.Core;
using DG.Tweening;
using BingoBrain.HotFix;
using FGUI.JBingoPlay;
using System.Collections.Generic;
using Random = UnityEngine.Random;
using FGUI.ACommon;
using Spine.Unity;
namespace BingoBrain
{
public class BingoStartUI : BaseUI
{
private BingoStartUICtrl ctrl;
private BingoStartModel model;
public com_play ui;
private com_AddBall com_Add;
private Action CloseCb;
private GTweener ballonTweenr;
private List<com_Num> poolComNum = new();
private List<com_Num> showComNum = new();
private List<Vector2> showComNumPot = new();
private bool isInited;
private Tween energyTween;
private float moveTime = 3;
private bool isLeft = true;
private Tween waitTween;
private bool isMoveFinish = true;
private GameObject ballIdle;
private GameObject ballEnter;
private int click_number = -1;
private bool IsBallonCD => GameHelper.GetNowTime() < PreferencesMgr.Instance.BallonCdTime;
public BingoStartUI(BingoStartUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoStartUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JBingoPlay";
uiInfo.assetName = "com_play";
uiInfo.layerType = UILayerType.Normal;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
}
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoStartModel) as BingoStartModel;
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as com_play;
}
private bool is_safearea = false;
protected override void OnOpenBefore(object args)
{
if (Screen.safeArea.y != 0 && !is_safearea)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
is_safearea = true;
}
Audio.Instance.StopBGM();
click_number = 0;
ui.btn_star.icon_image.fillAmount = 0;
ui.btn_star.progress_text.text = "0/3";
ui.btn_star.progress.width = 0;
if (isInited)
{
return;
}
InitData();
InitView();
}
private void InitData()
{
isInited = true;
Hall.Instance.SetGaming(true);
model.show101 = PreferencesMgr.Instance.Currency101;
model.show102 = PreferencesMgr.Instance.Currency102;
poolComNum.Clear();
showComNum.Clear();
poolComNum.Add(ui.com_CallNum.com_Num1);
poolComNum.Add(ui.com_CallNum.com_Num2);
poolComNum.Add(ui.com_CallNum.com_Num3);
poolComNum.Add(ui.com_CallNum.com_Num4);
poolComNum.Add(ui.com_CallNum.com_Num5);
showComNumPot.Add(ui.com_CallNum.com_Num5.position);
showComNumPot.Add(ui.com_CallNum.com_Num4.position);
showComNumPot.Add(ui.com_CallNum.com_Num3.position);
showComNumPot.Add(ui.com_CallNum.com_Num2.position);
showComNumPot.Add(ui.com_CallNum.com_Num1.position);
Vector3 localPos = ui.com_prop.size / 2;
localPos += ui.com_prop.position;
BingoCell.propOriginPos = GRoot.inst.LocalToGlobal(localPos);
BingoCell.propOriginPos = CameraBoardk.Instance.FGUIPosToWorldPos(BingoCell.propOriginPos);
isShowGameOver = false;
BingoCell.GetCoinSum = 0;
BingoCell.GetCashSum = 0;
}
private void InitView()
{
Set101();
Set102();
if (GameHelper.IsGiftSwitch())
{
(ui.btn_cash as com_102).gift.selectedIndex = 1;
(ui.btn_ballon as btn_balloon).gift.selectedIndex = 1;
}
else
{
ui.btn_star.visible = false;
}
GameHelper.SetGObject("btn_prop", ui.com_prop);
FX.Instance.SetFx<ParticleSystem>(ui.com_AddBall.gp_fx, Fx_Type.fx_ball_enter, ps => { }, CloseCb);
MoveToOtherSide();
Hall.Instance.UpdateSecondEvent += UpdateSecond;
ui.touchable = false;
ui.com_prop.visible = !BingoCell.isFirstGame;
// ui.btn_close.visible = !BingoData.isFirstGame;
ui.btn_close.SetClick(OnBtnCloseClick);
ui.com_carddi.cont_card.selectedIndex = com_carddi.Card_keySum_0;
ui.com_AddBall.visible = false;
ui.fairyBatching = false;
ui.btn_ballon.visible = !IsBallonCD;
ui.btn_ballon.SetClick(OnClickBalloon);
if (ballEnter == null)
{
var effect = Battle.Instance.ShungTik.Get("Effect.spark.ballEffect", "ballEffect");
ballEnter = effect.transform.Find("fx_qiu_enter").gameObject;
ballIdle = effect.transform.Find("fx_qiu_idle").gameObject;
effect.transform.localScale = 100 * Vector3.one;
var wrapper = new GoWrapper();
wrapper.SetWrapTarget(effect, true);
ui.com_prop.gh_effect.SetNativeObject(wrapper);
}
SetIdleEffect();
ui.com_CallNum.btn_Speed.text = "X" + BingoCell.CallSpeed;
ui.com_CallNum.btn_Speed.SetClick(OnClickCallSpeed);
SetEnergy();
InitStartGameEvent();
RefreshUI();
}
private void OnClickCallSpeed()
{
Audio.Instance.PlayDynamicEffect("button");
BingoCell.CallSpeed = BingoCell.CallSpeed switch
{
1 => 2,
2 => 3,
_ => 1
};
}
private void InitStartGameEvent()
{
Sequence sequence = DOTween.Sequence();
sequence.Append(DOVirtual.DelayedCall(0.5f, () =>
{
Audio.Instance.StopBGM();
ui.fx_readygo.SetHook("Ready", () => { Audio.Instance.PlayDynamicEffect("ready_Ready"); });
ui.fx_readygo.SetHook("Go", () => { Audio.Instance.PlayDynamicEffect("ready_Go"); });
ui.fx_readygo.Play();
}).SetAutoKill());
sequence.Append(DOVirtual.DelayedCall(ui.fx_readygo.totalDuration, () =>
{
Audio.Instance.PlayBGM("bgm_play");
if (BingoCell.isFirstGame)
{
var pos = NNfds.WorldToUIPos(BingoCell.cardBoardList[0].cardList[0].Game
.gameObject);
GameHelper.SetGuidePos("third", pos);
}
else
{
GameHelper.SetGuidePos("fifth", ui.com_prop);
}
ui.touchable = true;
}).SetAutoKill());
sequence.Append(DOVirtual.DelayedCall(Time.deltaTime, () =>
{
// 开始叫号
gameDispatcher.Dispatch(BingoInfo.StartCallNum);
}).SetAutoKill());
}
#region
private void OnClickBalloon()
{
if (BingoCell.isProcedure || BingoCell.IsGuiding || BingoCell.isPropRewarding)
{
return;
}
Audio.Instance.PlayDynamicEffect("button");
GameHelper.GetVideo("reward_flyballoon", isSuccess =>
{
if (isSuccess)
{
ui.btn_ballon.touchable = false;
var rewardType = GameHelper.GetCommonModel().ballonRewardType[0];
double rewardCount = 0;
if (rewardType == 102)
{
rewardCount =
GameHelper.GetDynamicReward(rewardType, GameHelper.GetCommonModel().ballonReward102);
}
ui.btn_ballon.visible = false;
PreferencesMgr.Instance.BallonCdTime =
(int)(GameHelper.GetNowTime() + GameHelper.GetCommonModel().ballonCD);
GameHelper.GetRewardOnly(rewardType, (decimal)rewardCount, RewardOrigin.PlayBallon,
isSuccess => { ui.btn_ballon.touchable = true; }, ui.btn_ballon);
}
});
}
void MoveToOtherSide()
{
if (!ui.btn_ballon.visible)
{
return;
}
if (!isMoveFinish)
{
return;
}
float offset = 300;
isMoveFinish = false;
var btnBalloon = ui.btn_ballon.displayObject.gameObject.transform;
var sequence = DOTween.Sequence();
var pos1 = new Vector3(ui.left_top.x, ui.left_top.y - RandomKit.RandomRange(30, 100));
var posLocal1 = GameHelper.FguiToUnityLocalPot(pos1);
ui.btn_ballon.position = pos1;
var pos2 = new Vector3(ui.left_bottom.x, BingoCell.CenterUIPos.y + offset + RandomKit.RandomRange(200, 300));
var posLocal2 = GameHelper.FguiToUnityLocalPot(pos2);
var tw1 = btnBalloon.DOLocalMove(posLocal2, 3).SetEase(Ease.Linear);
sequence.Append(tw1);
var pos3 = new Vector3(ui.right_top.x, ui.right_top.y - RandomKit.RandomRange(30, 100));
var posLocal3 = GameHelper.FguiToUnityLocalPot(pos3);
var tw2 = btnBalloon.DOLocalMove(posLocal3, 3);
tw2.SetDelay(Random.Range(5, 7)).SetEase(Ease.Linear);
sequence.Append(tw2);
var pos4 = new Vector3(ui.right_bottom.x,
BingoCell.CenterUIPos.y + offset + RandomKit.RandomRange(200, 300));
var posLocal4 = GameHelper.FguiToUnityLocalPot(pos4);
var tw3 = btnBalloon.DOLocalMove(posLocal4, 3);
tw3.SetDelay(Random.Range(3, 5)).SetEase(Ease.Linear);
sequence.Append(tw3);
var tw4 = btnBalloon.DOLocalMove(posLocal1, 3);
tw4.SetDelay(Random.Range(5, 11)).SetEase(Ease.Linear);
sequence.Append(tw4);
var tw5 = DOVirtual.DelayedCall(Random.Range(5, 11), () => { });
sequence.Append(tw5);
sequence.OnComplete(() =>
{
isMoveFinish = true;
ui.btn_ballon.InvalidateBatchingState();
MoveToOtherSide();
});
}
private void UpdateSecond()
{
if (ui.btn_ballon.visible != !IsBallonCD)
{
ui.btn_ballon.visible = !IsBallonCD;
// 开始移动
if (ui.btn_ballon.visible)
{
MoveToOtherSide();
}
}
}
#endregion
void SetIdleEffect(bool isIdle = true)
{
ballIdle.SetActive(isIdle);
ballEnter.SetActive(!isIdle);
}
protected override void OnOpen(object args)
{
ui?.FadeIn();
}
private void OnBtnCloseClick()
{
if (BingoCell.isProcedure)
{
return;
}
if (!BingoCell.IsInGame)
{
return;
}
Audio.Instance.PlayDynamicEffect("button");
uiCtrlDispatcher.Dispatch(SkinInfo.LeaveBingoUI_Open);
}
void SetEnergy()
{
if (BingoCell.isPropRewarding)
{
return;
}
var originFillAmount = ui.com_prop.img_prg.fillAmount;
if (energyTween != null && energyTween.active)
{
energyTween?.Kill();
}
energyTween = DOVirtual.Float(originFillAmount, BingoCell.EnergyPrg, 0.5f,
prg => { ui.com_prop.img_prg.fillAmount = prg; });
}
private void CallNum(object obj)
{
RefreshUI();
var sum = (int)obj;
var item = GetComNum();
item.visible = true;
item.scale = Vector2.one;
item.alpha = 1;
// item.position = new Vector2(5, -140);
item.displayObject.gameObject.transform.localPosition = new Vector3(5, -140);
var localPos = GameHelper.FguiToUnityLocalPot(showComNumPot[4]);
item.displayObject.gameObject.transform.DOLocalMoveX(localPos.x, aniTime).SetEase(Ease.Linear);
item.displayObject.gameObject.transform.DOLocalMoveY(localPos.y, aniTime).SetEase(Ease.Linear);
// item.TweenMove(showComNumPot[4], aniTime);
item.text_num.text = GameHelper.GetNoDecimalUnitStr(sum);
item.cont_state.selectedIndex = (sum - 1) / 15;
for (var i = 0; i < showComNum.Count; i++)
{
var _Num = showComNum[i];
var index = i + (4 - showComNum.Count);
// _Num.TweenMove(showComNumPot[index], aniTime);
_Num.displayObject.gameObject.transform.DOLocalMoveX(showComNumPot[index].x, aniTime)
.SetEase(Ease.Linear);
if (i == 0 && showComNum.Count >= 4)
{
DOVirtual.Float(1, 0.6f, aniTime, e => { _Num.alpha = e; }).SetAutoKill();
}
if (index == 3)
{
DOVirtual.Float(1, 0.8f, aniTime, e => { _Num.scale = Vector2.one * e; }).SetAutoKill();
}
}
showComNum.Add(item);
}
private com_Num GetComNum()
{
com_Num item;
if (poolComNum.Count <= 0)
{
item = showComNum[0];
showComNum.RemoveAt(0);
}
else
{
item = poolComNum[0];
poolComNum.RemoveAt(0);
}
return item;
}
protected override void OnHide()
{
isInited = false;
ui?.FadeOut();
foreach (var comNum in showComNum)
{
comNum.visible = false;
poolComNum.Add(comNum);
}
Hall.Instance.SetGaming(false);
OnClearTween();
showComNum.Clear();
CloseCb?.Invoke();
Hall.Instance.UpdateSecondEvent -= UpdateSecond;
}
protected override void OnDisplay(object args)
{
OnOpenBefore(args);
OnOpen(args);
}
private void RefreshUI(object o = null)
{
ui.com_CallNum.btn_Speed.text_Speed.text = BingoCell.CallSpeed + "X";
ui.com_ballleft.text_numLeft.text =
GameHelper.GetNoDecimalUnitStr(BingoCell.MaxCallSum - BingoCell.calledList.Count);
var num = Math.Min(3, BingoCell.KeyCardSum);
ui.com_carddi.cont_card.selectedIndex = num;
}
#endregion
#region
protected override void AddListener()
{
uiCtrlDispatcher.AddListener(SkinInfo.CallEndUI_Close, RefreshUI);
gameDispatcher.AddListener(BingoInfo.CallNum, CallNum);
gameDispatcher.AddListener(BingoInfo.CallSpeedChange, RefreshUI);
gameDispatcher.AddListener(BingoInfo.StartBingoGame, OnStartBingoGame);
gameDispatcher.AddListener(BingoInfo.SelectOneNum, OnSelectOneCard);//点击
gameDispatcher.AddListener(BingoInfo.AddPropRewardFinish, OnAddPropRewardFinish);
gameDispatcher.AddListener(BingoInfo.StartFullEnergy, OnStartFullEnergy);
gameDispatcher.AddListener(BingoInfo.ShowGameOver, OnEndBingoGame);
gameDispatcher.AddListener(BingoInfo.KeyCardSumChane, RefreshUI);
gameDispatcher.AddListener(BingoInfo.AddBallSum, AddBallSum);
}
private void OnStartBingoGame(object obj)
{
// RefreshUI();
}
private bool isShowGameOver = false;
private void OnEndBingoGame(object obj)
{
if (isShowGameOver)
{
return;
}
isShowGameOver = true;
ui.fx_gameover.Stop();
Audio.Instance.PlayDynamicEffect("gameover");
ui.fx_gameover.Play(() =>
{
UICtrlDispatcher.Instance.Dispatch(SkinInfo.BingoEndUI_Open);
isShowGameOver = false;
CtrlCloseUI();
});
}
private void OnStartFullEnergy(object obj)
{
var type = (int)obj;
ui.com_prop.cont_prop.selectedIndex = type + 1;
SetIdleEffect(false);
}
private void OnAddPropRewardFinish(object obj)
{
ui.com_prop.cont_prop.selectedIndex = ui.com_prop._Prop_normal;
DOVirtual.Float(1, 0, 0.2f, prg => { ui.com_prop.img_prg.fillAmount = prg; }).OnComplete(() =>
{
SetIdleEffect();
SetEnergy();
}).SetAutoKill();
}
private SkeletonAnimation cardSpine;
private void OnSelectOneCard(object obj)//点击事件
{
click_number++;
Debug.Log(click_number);
if (GameHelper.IsGiftSwitch() && click_number >= 3)
{
Audio.Instance.PlayDynamicEffect("star");
click_number = 0;
//uiCtrlDispatcher.Dispatch(SkinInfo.StarRewardUI_Open);
if (cardSpine == null)
{
FX.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.spine_starreward, sk =>
{
cardSpine = sk;
NAAVsa.PlayAnim(cardSpine, "b", false);
// NAAVsa.AddCompleteEvent(cardSpine,(sk)=>{
// });
GTweener tweener1 = ui.spine_parent.TweenMove(GameHelper.GetUICenterPosition(ui), 0.75f).OnComplete(() =>
{
uiCtrlDispatcher.Dispatch(SkinInfo.StarRewardUI_Open);
ui.spine_parent.x = ui.btn_star.x;
ui.spine_parent.y = ui.btn_star.y;
}); // 位置从当前值渐变到新的坐标
tweener1.SetEase(EaseType.QuadOut);
// NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
// OnChangeCardFinish(null);
}, CloseCb);
}
else
{
NAAVsa.PlayAnim(cardSpine, "b", false);
// NAAVsa.AddCompleteEvent(cardSpine,(sk)=>{
// });
GTweener tweener1 = ui.spine_parent.TweenMove(GameHelper.GetUICenterPosition(ui), 0.75f).OnComplete(() =>
{
uiCtrlDispatcher.Dispatch(SkinInfo.StarRewardUI_Open);
ui.spine_parent.x = ui.btn_star.x;
ui.spine_parent.y = ui.btn_star.y;
}); // 位置从当前值渐变到新的坐标
tweener1.SetEase(EaseType.QuadOut);
}
}
ui.btn_star.icon_image.fillAmount = (float)click_number / 3;
ui.btn_star.progress_text.text = click_number + "/3";
ui.btn_star.progress.width = ((float)click_number / 3) * 138;
SetEnergy();
}
private float aniTime = 0.3f;
private void AddBallSum(object o)
{
var sum = (int)o;
// 第一段出现时间
var showTime = 0.4f;
// 等待时间
var IdleTime = 0.5f;
// 第二段飞行时间
var moveTime = 0.3f;
// 球飞行间隔
var dleFloat = 0.1f;
ui.com_AddBall.visible = true;
var sys = ui.LocalToGlobal(ui.com_ballleft.position + (Vector3)ui.com_ballleft.size / 2);
var tar = ui.com_AddBall.GlobalToLocal(sys);
GameDispatcher.Instance.Dispatch(BingoInfo.AddPause, 1);
Audio.Instance.PlayDynamicEffect("extraBall_show");
for (var i = 0; i < 5; i++)
{
var item = ui.com_AddBall.GetChildAt(i + 1);
item.visible = false;
item.alpha = 1;
var index = i;
if (sum > index)
{
item.visible = true;
Vector2 startPot = item.position;
item.position = ui.com_AddBall.size / 2;
item.scale = Vector2.zero;
DOVirtual.DelayedCall(index * dleFloat, () =>
{
item.TweenMove(startPot, showTime);
DOVirtual.Float(0.3f, 1, showTime, e => { item.scale = Vector2.one * e; }).OnComplete(() =>
{
DOVirtual.DelayedCall(IdleTime, () =>
{
DOVirtual.Float(1, 0.6f, moveTime, e =>
{
item.scale = Vector2.one * e;
item.alpha = e;
}).SetAutoKill();
DOVirtual.Float(1, 0.3f, moveTime / 2, e => { item.scale = Vector2.one * e; })
.SetAutoKill();
item.TweenMove(tar, moveTime).OnComplete(() =>
{
BingoCell.MaxCallSum += 1;
if (index == 0)
{
GameDispatcher.Instance.Dispatch(BingoInfo.AddPause, -1);
}
RefreshUI();
item.position = startPot;
item.visible = false;
if (sum == index + 1)
{
ui.com_AddBall.visible = false;
}
});
}).SetAutoKill();
}).SetAutoKill();
});
/*DOVirtual.DelayedCall(index * dleFloat, () =>
{
item.TweenMove(startPot, showTime);
DOVirtual.Float(0.3f, 1, showTime, e => { item.scale = Vector2.one * e; }).OnComplete(() =>
{
DOVirtual.DelayedCall(IdleTime, () =>
{
DOVirtual.Float(1, 0.6f, moveTime, e =>
{
item.scale = Vector2.one * e;
item.alpha = e;
}).SetAutoKill();
DOVirtual.Float(1, 0.3f, moveTime / 2, e => { item.scale = Vector2.one * e; })
.SetAutoKill();
item.TweenMove(tar, moveTime).OnComplete(() =>
{
BingoData.MaxCallSum += 1;
RefreshUI();
item.position = startPot;
item.visible = false;
if (index == 0)
{
GameDispatcher.Instance.Dispatch(GameMsg.AddPause, -1);
}
if (sum == index + 1)
{
ui.com_AddBall.visible = false;
}
});
}).SetAutoKill();
}).SetAutoKill();
}).SetAutoKill();*/
}
}
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(SkinInfo.CallEndUI_Close, RefreshUI);
gameDispatcher.RemoveListener(BingoInfo.CallNum, CallNum);
gameDispatcher.RemoveListener(BingoInfo.CallSpeedChange, RefreshUI);
gameDispatcher.RemoveListener(BingoInfo.SelectOneNum, OnSelectOneCard);
gameDispatcher.RemoveListener(BingoInfo.AddPropRewardFinish, OnAddPropRewardFinish);
gameDispatcher.RemoveListener(BingoInfo.StartFullEnergy, OnStartFullEnergy);
gameDispatcher.RemoveListener(BingoInfo.ShowGameOver, OnEndBingoGame);
gameDispatcher.RemoveListener(BingoInfo.KeyCardSumChane, RefreshUI);
gameDispatcher.RemoveListener(BingoInfo.AddBallSum, AddBallSum);
}
#endregion
public void Set101(string coinStr = null)
{
if (coinStr == null)
{
coinStr = PreferencesMgr.Instance.Currency101 == -1
? GameHelper.GetCommonModel().Init101Num.ToString("N0")
: PreferencesMgr.Instance.Currency101.ToString("N0");
}
// 房间券余额 数值
ui.btn_coin.GetChild("title").text = coinStr;
}
public void Set102(string cashStr = null)
{
if (cashStr == null)
{
cashStr = PreferencesMgr.Instance.Currency102 == -1
? GameHelper.GetCommonModel().Init102Num.ToString("N")
: PreferencesMgr.Instance.Currency102.ToString("N");
}
// 房间券余额 数值
ui.btn_cash.GetChild("title").text = cashStr;
(ui.btn_ballon as btn_balloon).cash_text.text = GameHelper.GetDynamicReward(102, GameHelper.GetCommonModel().ballonReward102).ToString("0.00");
}
private void OnClearTween()
{
ballonTweenr?.Kill();
ballonTweenr = null;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 96f0c2f707e64bdb848dd8e348dd02b6
timeCreated: 1679367555
@@ -0,0 +1,128 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoStartUICtrl : BaseUICtrl
{
private BingoStartUI ui;
private BingoStartModel model;
private uint openUIMsg = SkinInfo.BingoStartUI_Open;
private uint closeUIMsg = SkinInfo.BingoStartUI_Close;
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoStartModel) as BingoStartModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BingoStartUI(this);
ui.Open(args);
}
else
{
ui.Display(args);
}
}
public override void CloseUI(object args = null)
{
if (ui != null && !ui.isClose)
{
ui.Hide();
}
}
#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.Instance.AddListener(BingoInfo.Update101, OnUpdate101);
GameDispatcher.Instance.AddListener(BingoInfo.Update102, OnUpdate102);
GameDispatcher.Instance.AddListener(BingoInfo.Update101Completed, OnUpdate101Completed);
GameDispatcher.Instance.AddListener(BingoInfo.Update102Completed, OnUpdate102Completed);
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
GameDispatcher.Instance.RemoveListener(BingoInfo.Update101, OnUpdate101);
GameDispatcher.Instance.RemoveListener(BingoInfo.Update102, OnUpdate102);
GameDispatcher.Instance.RemoveListener(BingoInfo.Update101Completed, OnUpdate101Completed);
GameDispatcher.Instance.RemoveListener(BingoInfo.Update102Completed, OnUpdate102Completed);
}
#endregion
private void OnUpdate101(object obj)
{
if (obj == null) return;
var changeValue = (decimal)obj;
if (model != null)
{
model.show101 += changeValue;
ui?.Set101(model.show101.ToString("N0"));
}
}
private void OnUpdate101Completed(object obj)
{
if (PreferencesMgr.Instance.IsShowRewardFly101) return;
var value = PreferencesMgr.Instance.Currency101;
if (model != null)
{
model.show101 = value;
}
ui?.Set101();
}
private void OnUpdate102(object obj)
{
if (obj == null) return;
var changeValue = (decimal)obj;
if (model != null)
{
model.show102 += changeValue;
ui?.Set102(model.show102.ToString("N"));
}
}
private void OnUpdate102Completed(object obj)
{
if (PreferencesMgr.Instance.IsShowRewardFly102) return;
var value = PreferencesMgr.Instance.Currency102;
if (model != null)
{
model.show102 = value;
}
ui?.Set102();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1bdebf52166b46e386a23c4b08c69a2c
timeCreated: 1679367555
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 84bd498ddb854301b6f7ffeadd67da66
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoToyCtrl : BaseCtrl
{
public static BingoToyCtrl Instance { get; private set; }
private BingoToyModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 36d23c7382a24211a72f44df9ae5400f
timeCreated: 1679564096
@@ -0,0 +1,53 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoToyModel : BaseModel
{
public float animationTime = 6f;
public string NextOpenWheelTimeStr
{
get
{
var val = PreferencesMgr.Instance.NextOpenWheelStampTime - GameHelper.GetNowTime();
return val > 0 ? GameHelper.GetInterval(val) : "00:00:00";
}
}
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
#region
protected override void AddListener()
{
ctrlDispatcher.AddListener(CtrlMsg.GameNewDays, NewDay);
}
private void NewDay(object obj)
{
PreferencesMgr.Instance.IsOnceWheel = true;
}
protected override void RemoveListener()
{
ctrlDispatcher.RemoveListener(CtrlMsg.GameNewDays, NewDay);
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: dbf609aa6837440d83ffaf0a2c9a3cd2
timeCreated: 1679564096
@@ -0,0 +1,308 @@
using System;
using UnityEngine;
using DG.Tweening;
using BingoBrain.Core;
using FGUI.JWheel;
using System.Collections.Generic;
namespace BingoBrain
{
public class BingoToyUI : BaseUI
{
private BingoToyUICtrl ctrl;
private BingoToyModel model;
public com_wheel ui;
private List<com_reward> com_RewardLst = new();
private int[] freeWeight = new int[8];
private List<float> vidieWeight = new();
private bool isClickSpin;
private Action CloseCb;
private ParticleSystem fx_zhuangpan_enter;
public BingoToyUI(BingoToyUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoToyUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JWheel";
uiInfo.assetName = "com_wheel";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = true;
uiInfo.isNeedCloseAnim = true;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
model = ModuleBoardk.GetModel(ModelConst.BingoToyModel) as BingoToyModel;
}
protected override void OnClose()
{
ui?.FadeOut();
Hall.Instance.UpdateSecondEvent -= UpdateTime;
CloseCb?.Invoke();
}
protected override void OnBind()
{
ui = baseUI as com_wheel;
}
protected override void OnOpenBefore(object args)
{
Audio.Instance.PlayDynamicEffect("pop_open");
FX.Instance.SetFx<ParticleSystem>(ui.gp_Fx, Fx_Type.fx_zhuangpan_enter, ps =>
{
fx_zhuangpan_enter = ps;
fx_zhuangpan_enter.gameObject.SetActive(false);
}, CloseCb);
FX.Instance.SetFx<ParticleSystem>(ui.com_wheels.gp_Select, Fx_Type.fx_zhuanpan_Select,
ps => { ps.transform.localPosition = new Vector3(0, 195, 0); }, CloseCb);
ui.com_wheels.gp_Select.visible = false;
SetWheelData();
com_RewardLst.Add(ui.com_wheels.com_reward1);
com_RewardLst.Add(ui.com_wheels.com_reward2);
com_RewardLst.Add(ui.com_wheels.com_reward3);
com_RewardLst.Add(ui.com_wheels.com_reward4);
com_RewardLst.Add(ui.com_wheels.com_reward5);
com_RewardLst.Add(ui.com_wheels.com_reward6);
com_RewardLst.Add(ui.com_wheels.com_reward7);
com_RewardLst.Add(ui.com_wheels.com_reward8);
var dataList = GameHelper.GetConfig<TurntableModel>().GetDataList();
for (var i = 0; i < dataList.Count; i++)
{
freeWeight[i] = dataList[i].weightA;
vidieWeight.Add(dataList[i].weightB);
}
ui.closeButton.SetClick(CtrlCloseUI);
ui.btn_spin.SetClick(ClickSpinBtn);
ui.com_Spinn.SetClick(ClickSpinBtn);
ui.fairyBatching = false;
Hall.Instance.UpdateSecondEvent += UpdateTime;
}
private void UpdateTime()
{
ui.btn_spin.cont_button.selectedIndex =
GameHelper.GetNowTime() >= PreferencesMgr.Instance.NextOpenWheelStampTime
? btn_spin.Button_none
: btn_spin.Button_cd;
ui.btn_spin.text_time.text = model.NextOpenWheelTimeStr;
}
private void SetWheelData()
{
if (PreferencesMgr.Instance.WheelVersion != GameHelper.GetDynamicVersion())
{
PreferencesMgr.Instance.FerrWheelLst.Clear();
PreferencesMgr.Instance.VidelWheelLst.Clear();
}
var turntableModel = GameHelper.GetConfig<TurntableModel>();
// if (PreferencesMgr.Instance.FerrWheelLst.Count < turntableModel.GetCount() ||
// PreferencesMgr.Instance.VidelWheelLst.Count < turntableModel.GetCount())
// {
Debug.Log("????????????????ttttttttttttttttt");
PreferencesMgr.Instance.FerrWheelLst.Clear();
PreferencesMgr.Instance.VidelWheelLst.Clear();
var list = turntableModel.GetDataList();
foreach (var item in list)
{
PreferencesMgr.Instance.FerrWheelLst.Add(
item.quantityA[GameHelper.GetDynamicIndex(item.wheel_itemA)]);
PreferencesMgr.Instance.VidelWheelLst.Add(
item.quantityB[GameHelper.GetDynamicIndex(item.wheel_itemB)]);
}
PreferencesMgr.Instance.SaveFerrWheelLst();
PreferencesMgr.Instance.SaveVidelWheelLst();
PreferencesMgr.Instance.WheelVersion = GameHelper.GetDynamicVersion();
// }
}
protected override void OnOpen(object args)
{
ui?.FadeIn();
UpdateTime();
RefreshUI();
ui.cont_state.selectedIndex =
PreferencesMgr.Instance.IsOnceWheel ? com_wheel.State_normal : com_wheel.State_videl;
}
private void RefreshUI(object o = null)
{
var turntableModel = GameHelper.GetConfig<TurntableModel>();
for (var i = 0; i < com_RewardLst.Count; i++)
{
var rewards = com_RewardLst[i];
if (GameHelper.IsGiftSwitch()) rewards.gift.selectedIndex = 1;
var turntable = turntableModel.GetData(i + 1);
int id;
string val;
if (PreferencesMgr.Instance.IsOnceWheel)
{
id = turntable.wheel_itemA;
val = id == 102
? GameHelper.Get102Str((decimal)PreferencesMgr.Instance.FerrWheelLst[i])
: PreferencesMgr.Instance.FerrWheelLst[i].ToString();
}
else
{
id = turntable.wheel_itemB;
val = id == 102
? GameHelper.Get102Str((decimal)PreferencesMgr.Instance.VidelWheelLst[i])
: PreferencesMgr.Instance.VidelWheelLst[i].ToString();
}
rewards.cont_currency.selectedIndex = id switch
{
101 => com_reward.Currency_coin,
102 => com_reward.Currency_diam,
104 => com_reward.Currency_card,
_ => rewards.cont_currency.selectedIndex
};
rewards.text_num.text = val;
}
}
private void ClickSpinBtn()
{
if (isClickSpin)
return;
if (!PreferencesMgr.Instance.IsOnceWheel)
{
if (GameHelper.GetNowTime() < PreferencesMgr.Instance.NextOpenWheelStampTime)
{
return;
}
GameHelper.GetVideo("reward_wheel", isSuccess =>
{
if (isSuccess)
{
PlayLucky();
}
});
}
else
{
PlayLucky();
}
}
private void PlayLucky()
{
isClickSpin = true;
ui.closeButton.touchable = false;
ui.closeButton.grayed = true;
ui.btn_spin.touchable = false;
ui.btn_spin.grayed = true;
ui.com_Spinn.touchable = false;
ui.com_Spinn.cont_spin.selectedIndex = com_spin.Spin_grey;
ui.closeButton.touchable = false;
ui.com_wheels.rotation = 0;
var index = PreferencesMgr.Instance.IsOnceWheel
? GlobalHarmony.RandomWeight(freeWeight)
: GlobalHarmony.GetChanceList(vidieWeight);
var turntableModel = GameHelper.GetConfig<TurntableModel>();
var vo = turntableModel.GetData(index + 1);
var angle = UnityEngine.Random.Range(3600 - (vo.Seq - 1) * 45 - 10, 3600 - (vo.Seq - 1) * 45 + 10) +
22.5f;
Audio.Instance.PlayDynamicEffect("wheel_spin");
ui.fx_zhen.Play();
DOTween.To(() => ui.com_wheels.rotation, (e) => ui.com_wheels.rotation = e, angle, model.animationTime)
.SetEase(AnimationCurveData.Instance.LuckySpinAniCurve);
tw = DOVirtual.DelayedCall(model.animationTime, () => OpenReceivePlane(vo));
}
private Tween tw;
private void OpenReceivePlane(Turntable vo)
{
ui.fx_zhen.Stop();
ui.img_zhen.rotation = 0;
ui.com_wheels.gp_Select.visible = true;
ui.com_wheels.gp_Select.rotation = (vo.Seq - 2) * 45 + 22.5f;
DOVirtual.DelayedCall(1.5f, () =>
{
ui.com_wheels.gp_Select.visible = false;
isClickSpin = false;
tw = null;
ui.closeButton.touchable = true;
ui.btn_spin.touchable = true;
ui.com_Spinn.touchable = true;
ui.btn_spin.grayed = false;
ui.closeButton.grayed = false;
ui.com_Spinn.cont_spin.selectedIndex = com_spin.Spin_none;
if (PreferencesMgr.Instance.IsOnceWheel)
{
ui.closeButton.touchable = false;
ui.btn_spin.touchable = false;
ui.com_Spinn.touchable = false;
ui.btn_spin.grayed = true;
GameHelper.GetRewardExtra(vo.wheel_itemA, (decimal)PreferencesMgr.Instance.FerrWheelLst[vo.Seq - 1],
vo.cont_index, isCompleted =>
{
PreferencesMgr.Instance.FerrWheelLst.Clear();
PreferencesMgr.Instance.IsOnceWheel = false;
ui.fx_exit.Play();
var sequence = DOTween.Sequence();
sequence.Append(DOVirtual.DelayedCall(0.75f, () =>
{
ui.cont_state.selectedIndex = PreferencesMgr.Instance.IsOnceWheel
? com_wheel.State_normal
: com_wheel.State_videl;
SetWheelData();
RefreshUI();
ui.fx_enter.Play();
}));
sequence.Append(DOVirtual.DelayedCall(0.75f, () =>
{
fx_zhuangpan_enter.gameObject.SetActive(true);
ui.closeButton.touchable = true;
ui.btn_spin.touchable = true;
ui.com_Spinn.touchable = true;
ui.btn_spin.grayed = false;
Audio.Instance.PlayDynamicEffect("wheel_show");
}));
});
}
else
{
GameHelper.GetRewardOnly(vo.wheel_itemB,
(decimal)PreferencesMgr.Instance.VidelWheelLst[vo.Seq - 1], RewardOrigin.Wheel);
PreferencesMgr.Instance.VidelWheelLst.Clear();
PreferencesMgr.Instance.NextOpenWheelStampTime =
GameHelper.GetNowTime() + GameHelper.GetCommonModel().TurntableCD;
UpdateTime();
SetWheelData();
RefreshUI();
}
});
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b550d156353c43678858ff3266c0ba0a
timeCreated: 1679564096
@@ -0,0 +1,71 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoToyUICtrl : BaseUICtrl
{
private BingoToyUI ui;
private BingoToyModel model;
private uint openUIMsg = SkinInfo.BingoToyUI_Open;
private uint closeUIMsg = SkinInfo.BingoToyUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BingoToyUI(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: 91d3d68cfa3940a09eb1179bfa1d54a6
timeCreated: 1679564096
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f61f2ecb148f4e8db39343692eadf9d3
timeCreated: 1699933728
@@ -0,0 +1,25 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoWhatCtrl : BaseCtrl
{
public static BingoWhatCtrl Instance { get; private set; }
private BingoWhatModel model;
#region
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 84376285cc28416a80c7089cd95df41f
timeCreated: 1680055697
@@ -0,0 +1,23 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BingoWhatModel : BaseModel
{
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a6fe187c569f4ca3acfde8dd629aaeb6
timeCreated: 1680055697
@@ -0,0 +1,55 @@
using BingoBrain.Core;
using FGUI.JSettings;
namespace BingoBrain
{
public class BingoWhatUI : BaseUI
{
private BingoWhatUICtrl ctrl;
private BingoWhatModel model;
private com_howto ui;
public BingoWhatUI(BingoWhatUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BingoWhatUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "JSettings";
uiInfo.assetName = "com_howto";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = true;
uiInfo.isNeedCloseAnim = true;
uiInfo.isNeedUIMask = true;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as com_howto;
}
protected override void OnOpenBefore(object args)
{
ui.closeButton.onClick.Set(CtrlCloseUI);
Audio.Instance.PlayDynamicEffect("pop_open");
}
protected override void OnOpen(object args)
{
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4110349d20ef4022bf99411f14f4a093
timeCreated: 1680055697
@@ -0,0 +1,71 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BingoWhatUICtrl : BaseUICtrl
{
private BingoWhatUI ui;
private BingoWhatModel model;
private uint openUIMsg = SkinInfo.BingoWhatUI_Open;
private uint closeUIMsg = SkinInfo.BingoWhatUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BingoWhatUI(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: e176357a01ef44c0a19b5e74aa93d6fc
timeCreated: 1680055697
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e83c3e26fb984bfba1e827d694e5af68
timeCreated: 1699933728
@@ -0,0 +1,21 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BottomCtrl : BaseCtrl
{
public static BottomCtrl Instance { get; private set; }
private BottomModel model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 060584ef18174bad89fd4e584daa1e2a
timeCreated: 1678954992
@@ -0,0 +1,19 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BottomModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6d5f01274c034fbaa06f51ddda444a1b
timeCreated: 1678954992
@@ -0,0 +1,55 @@
using BingoBrain.Core;
using FGUI.ABigImg;
namespace BingoBrain
{
public class BottomUI : BaseUI
{
private BottomUICtrl ctrl;
private BottomModel model;
private com_mainbg ui;
public BottomUI(BottomUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BottomUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "ABigImg";
uiInfo.assetName = "com_mainbg";
uiInfo.layerType = UILayerType.Background;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = true;
uiInfo.isNeedUIMask = false;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
GlobalHarmony.Out(ui);
}
protected override void OnBind()
{
ui = baseUI as com_mainbg;
}
protected override void OnOpenBefore(object args)
{
}
protected override void OnOpen(object args)
{
GlobalHarmony.In(ui);
}
#endregion
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 108fe7d0372a4c84ae591713fa9dd6e0
timeCreated: 1678954992
@@ -0,0 +1,71 @@
using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class BottomUICtrl : BaseUICtrl
{
private BottomUI ui;
private BottomModel model;
private uint openUIMsg = SkinInfo.BottomUI_Open;
private uint closeUIMsg = SkinInfo.BottomUI_Close;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BottomUI(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: ef8105d40abb4d5c87c0b7ab3d703caa
timeCreated: 1678954992
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6a75b13f9cb7947f5b8dea47775fd401
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using BingoBrain.Core;
namespace BingoBrain
{
public class BroadcastCtrl : BaseCtrl
{
public static BroadcastCtrl Instance { get; private set; }
private BroadcastModel model;
protected override void OnInit()
{
Instance = this;
}
protected override void OnDispose()
{
Instance = null;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 575f1d3d71a8445bc8d960a3f33d8bc1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
using BingoBrain.Core;
namespace BingoBrain
{
public class BroadcastModel : BaseModel
{
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
protected override void OnReset()
{
throw new System.NotImplementedException();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2362fee130b6f4067b943f44ba629113
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,223 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using DG.Tweening;
using Spine.Unity;
using BingoBrain.Core;
using FGUI.ACommon;
using FairyGUI;
namespace BingoBrain
{
public class BroadcastUI : BaseUI
{
private BroadcastUICtrl ctrl;
private BroadcastModel model;
private FGUI.ACommon.com_broadcast1 ui;
public BroadcastUI(BroadcastUICtrl ctrl) : base(ctrl)
{
uiName = UIConst.BroadcastUI;
this.ctrl = ctrl;
}
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "ACommon";
uiInfo.assetName = "com_broadcast1";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
uiInfo.isNeedCloseAnim = false;
uiInfo.isNeedUIMask = false;
}
#region
protected override void OnInit()
{
}
protected override void OnClose()
{
}
protected override void OnBind()
{
ui = baseUI as FGUI.ACommon.com_broadcast1;
}
protected override void OnOpenBefore(object args)
{
InitView();
//ui.y = 241;
// if (UI.Instance.IsExistUI(UIConst.RainPlayUI))
// {
// Setbuttom();
// }
// else
// {
// Settop();
// }
// ui.visible = false;
// if (Screen.safeArea.y != 0)
// {//刘海屏
// ui.y += Screen.safeArea.y;
// }
text_ui = ui.broad_cast_text;
ui.btn_record.SetClick(OpenRecord);
ui.broad_cast_text.btn_broad.SetClick(OpenRecord);
if (ConfigSystem.GetConfig<exBrPoolModel>() == null) return;
// ConfigSystem.GetConfig<exBrPoolModel_2>().dataList[0]
config_name_list = exBrPoolModel.config_name_list;
config_money_list = exBrPoolModel.config_money_list;
GameDispatcher.Instance.AddListener(GameMsg.hideBroadCast, hideEvent);
GameDispatcher.Instance.AddListener(GameMsg.showBroadCast, showEvent);
// UICtrlDispatcher.Instance.AddListener(UICtrlMsg.MainUI_Open, Settop);
// UICtrlDispatcher.Instance.AddListener(UICtrlMsg.RainPlayUI_Open, Setbuttom);
}
protected override void OnOpen(object args)
{
}
protected override void OnHide()
{
}
protected override void OnDisplay(object args)
{
}
#endregion
#region
protected override void AddListener()
{
}
protected override void RemoveListener()
{
}
#endregion
private int time_count = 11;
private com_broadcast_text1 text_ui;
private List<string> config_name_list;
private List<string> config_money_list;
private bool main_ui_show = true;
//初始化页面逻辑
private Action closeCallback = null;
private void InitView()
{
Hall.Instance.UpdateSecondEvent += timeEvent;
// var sk = FX.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, closeCallback);
// sk.state.SetAnimation(0, "animation", true);
FX.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, sk =>
{
// ske_pot = sk;
// NAAVsa.AddCompleteEvent(cardSpine, OnChangeCardFinish);
// OnChangeCardFinish(null);
NAAVsa.PlayAnim(sk, "animation", true);
}, closeCallback);
ui.group_.y = 220;
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
}
}
private void OpenRecord()
{
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RecordViewUI_Open);
}
private void hideEvent(object sender = null)
{
Debug.Log("hide");
main_ui_show = false;
ui.visible = false;
}
private void showEvent(object sender = null)
{
Debug.Log("show");
main_ui_show = true;
ui.visible = true;
}
private void Settop(object sender = null)
{
ui.group_.y = 241;
if (Screen.safeArea.y != 0)
{//刘海屏
ui.group_.y += Screen.safeArea.y;
}
}
private void Setbuttom(object sender = null)
{
ui.group_.y = GRoot.inst.height - 300;
}
void timeEvent()
{
time_count++;
// if (time_count > 30)
// {
// time_count = 0;
// var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
// var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
// if (main_ui_show)
// {
// ui.visible = true;
// }
// Debug.Log(text_ui.cast_text.text);
// text_ui.cast_text.text = String.Format(text_ui.hide_text.text, config_name_list[name_index],
// config_money_list[money_index], DateTimeBoardk.Instance.GetCurrDateTime());
// text_ui.cast_text.x = 686;
// Tweener tweener = DOTween.To(() => text_ui.cast_text.x,
// x => text_ui.cast_text.x = x, -1300, 10);
// }
// time_count = 0;
//Debug.Log($"barry broad time count======== {time_count}");
if (time_count > 20)
{
time_count = 0;
var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
Debug.Log(text_ui.cast_text.text);
string name = config_name_list[name_index];
if (name.Length > 4)
{
name = name[..4] + "...";
}
string broad_text = String.Format(text_ui.hide_text.text, name,
"$" + config_money_list[money_index], DateTimeBoardk.Instance.GetCurrDateTime());
text_ui.cast_text.text = broad_text;
// Tweener tweener = DOTween.To(() => ui.broad.x,
// x => ui.broad.x = x, 200, 0.5f);
ui.t0.Play();
DOVirtual.DelayedCall(3.5f, () =>
{
// Tweener tweener = DOTween.To(() => ui.broad.x,
// x => ui.broad.x = x, 1080, 0.5f);
ui.t1.Play();
});
string str = name + "-" + config_money_list[money_index] + "-" + DateTimeBoardk.Instance.GetCurrDateTime();
GameDispatcher.Instance.Dispatch(GameMsg.updateRecordList, str);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d9a4125b4c0c64c94857a7ac85479526
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Generic;
using BingoBrain.Core;
namespace BingoBrain
{
public class BroadcastUICtrl : BaseUICtrl
{
private BroadcastUI ui;
private BroadcastModel model;
private uint openUIMsg = UICtrlMsg.BroadcastUI_Open;
private uint closeUIMsg = UICtrlMsg.BroadcastUI_Close;
#region
protected override void OnInit()
{
//model = ModuleManager.Instance.GetModel(ModelConst.BroadcastModel) as BroadcastModel;
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null)
{
ui = new BroadcastUI(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);
}
protected override void AddServerListener()
{
}
protected override void RemoveServerListener()
{
}
#endregion
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 35a4fff4d50cc4404951bdbed6e43b22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b5ee8e7c4872b428b8efc7420ec10edc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More