fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -1,22 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FutureCore;
|
||||
using FairyGUI;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DG.Tweening;
|
||||
using FGUI.ZM_Common_01;
|
||||
using Spine.Unity;
|
||||
using FlowerPower;
|
||||
using FGUI.P01_Common;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class BroadcastUI : BaseUI
|
||||
{
|
||||
private BroadcastUICtrl ctrl;
|
||||
private BroadcastModel model;
|
||||
private FGUI.P01_Common.com_broadcast1 ui;
|
||||
private com_broadcast1 ui;
|
||||
|
||||
public BroadcastUI(BroadcastUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
@@ -26,9 +22,9 @@ namespace FlowerPower
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "P01_Common";
|
||||
uiInfo.packageName = "ZM_Common_01";
|
||||
uiInfo.assetName = "com_broadcast1";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.layerType = UILayerType.Highest;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
@@ -42,12 +38,11 @@ namespace FlowerPower
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent -= timeEvent;
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.P01_Common.com_broadcast1;
|
||||
ui = baseUI as com_broadcast1;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
@@ -57,11 +52,13 @@ namespace FlowerPower
|
||||
|
||||
if (UIManager.Instance.IsExistUI(UIConst.RainPlayUI))
|
||||
{
|
||||
Setbuttom();
|
||||
|
||||
Settop();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Settop();
|
||||
Setbuttom();
|
||||
}
|
||||
// ui.visible = false;
|
||||
// if (Screen.safeArea.y != 0)
|
||||
@@ -70,16 +67,17 @@ namespace FlowerPower
|
||||
// }
|
||||
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;
|
||||
config_name_list = ConfigSystem.GetConfig<exBrPoolModel>().config_name_list;
|
||||
config_money_list = ConfigSystem.GetConfig<exBrPoolModel>().config_money_list;
|
||||
text_ui.btn_broad.SetClick(OpenRecord);
|
||||
|
||||
if (ConfigSystem.GetConfig<SubscribePodcast>() == null) return;
|
||||
config_name_list = SubscribePodcastModel.config_name_list;
|
||||
config_vip_level_list = SubscribePodcastModel.config_vip_level_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);
|
||||
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.MainUI_Open, Setbuttom);
|
||||
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.RainPlayUI_Open, Settop);
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
@@ -108,11 +106,11 @@ namespace FlowerPower
|
||||
private int time_count = 11;
|
||||
private com_broadcast_text1 text_ui;
|
||||
private List<string> config_name_list;
|
||||
private List<string> config_money_list;
|
||||
private List<string> config_vip_level_list;
|
||||
private bool main_ui_show = true;
|
||||
//初始化页面逻辑
|
||||
|
||||
private Action closeCallback = null;
|
||||
private Action closeCallback;
|
||||
private void InitView()
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent += timeEvent;
|
||||
@@ -120,6 +118,7 @@ namespace FlowerPower
|
||||
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, ref closeCallback);
|
||||
sk.state.SetAnimation(0, "animation", true);
|
||||
ui.broad_cast_text.bg_panel.SetScale(1.45f, 1.1f);
|
||||
}
|
||||
|
||||
private void OpenRecord()
|
||||
@@ -140,79 +139,83 @@ namespace FlowerPower
|
||||
}
|
||||
private void Settop(object sender = null)
|
||||
{
|
||||
ui.group_.y = 578;
|
||||
// if (Screen.safeArea.y != 0)
|
||||
// {//刘海屏
|
||||
// ui.group_.y += Screen.safeArea.y;
|
||||
// }
|
||||
ui.group_.y = 350;
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.group_.y += 68;
|
||||
}
|
||||
}
|
||||
private void Setbuttom(object sender = null)
|
||||
{
|
||||
//ui.group_.y = GRoot.inst.height - 300;
|
||||
ui.group_.y = 431;
|
||||
ui.group_.y = 170;
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.group_.y += Screen.safeArea.y;
|
||||
ui.group_.y += 68;
|
||||
}
|
||||
}
|
||||
# if GAME_RELEASE
|
||||
private const int MaxTime = 300;
|
||||
#else
|
||||
private const int MaxTime = 10;
|
||||
#endif
|
||||
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], DateTimeManager.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)
|
||||
Debug.Log(time_count);
|
||||
Debug.Log(MaxTime);
|
||||
if (time_count > MaxTime)
|
||||
{
|
||||
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);
|
||||
var name_index = Random.Range(0, config_name_list.Count);
|
||||
var money_index = Random.Range(0, config_vip_level_list.Count);
|
||||
Debug.Log(text_ui.cast_text.text);
|
||||
|
||||
string name = config_name_list[name_index];
|
||||
if (name.Length > 4)
|
||||
if (name.Length > 8)
|
||||
{
|
||||
name = name[..4] + "...";
|
||||
name = name[..8] + "..";
|
||||
}
|
||||
|
||||
text_ui.hide_text.text = GameHelper.getDesByKey("makeup_4");
|
||||
string broad_text = String.Format(text_ui.hide_text.text, name,
|
||||
config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
|
||||
config_vip_level_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
|
||||
text_ui.cast_text.text = broad_text;
|
||||
|
||||
var lv = GetVipLevelFromName(config_vip_level_list[money_index]);
|
||||
text_ui.broad_icon_loader.url = $"ui://LG_Common/vip_{lv}";
|
||||
|
||||
// Tweener tweener = DOTween.To(() => ui.broad.x,
|
||||
// x => ui.broad.x = x, 200, 0.5f);
|
||||
ui.t0.Play();
|
||||
if (AudioManager.Instance.IsOpenEffect)
|
||||
{
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.BroadTips);
|
||||
}
|
||||
|
||||
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] + "-" + DateTimeManager.Instance.GetCurrDateTime();
|
||||
string str = name + "#" + config_vip_level_list[money_index] + "#" + DateTimeManager.Instance.GetCurrDateTime();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.updateRecordList, str);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int GetVipLevelFromName(string name)
|
||||
{
|
||||
var vip_level = 1;
|
||||
switch (name)
|
||||
{
|
||||
case "Gold":
|
||||
vip_level = 1;
|
||||
break;
|
||||
case "Platinum":
|
||||
vip_level = 2;
|
||||
break;
|
||||
case "Diamond":
|
||||
vip_level = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
return vip_level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user