fix:1、同步ios修复的bug
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.Game_04;
|
||||
using IgnoreOPS;
|
||||
using Spine.Unity;
|
||||
|
||||
namespace ChillConnect
|
||||
@@ -9,9 +12,8 @@ namespace ChillConnect
|
||||
{
|
||||
private OpenGameUICtrl ctrl;
|
||||
private OpenGameModel model;
|
||||
private com_open ui;
|
||||
private com_open_tips ui;
|
||||
private Action closeCallback;
|
||||
private bool need_show = true;
|
||||
|
||||
public OpenGameUI(OpenGameUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
@@ -21,12 +23,12 @@ namespace ChillConnect
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Game_04";
|
||||
uiInfo.assetName = "com_open";
|
||||
uiInfo.packageName = "Common_01";
|
||||
uiInfo.assetName = "com_open_tips";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
@@ -42,23 +44,43 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_open;
|
||||
ui = baseUI as com_open_tips;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null) need_show = (bool)args;
|
||||
string stage = GameHelper.gameType == 0 ? "Lv." + GameHelper.GetLevel() : "";
|
||||
ui.text_level.text = stage;
|
||||
try
|
||||
{
|
||||
// 添加空值检查,防止 NullReferenceException
|
||||
var makeupTaskHistory = DataMgr.MakeupTaskHistory?.Value;
|
||||
if (makeupTaskHistory != null && makeupTaskHistory.Any())
|
||||
{
|
||||
var makeupTaskData = makeupTaskHistory.Last();
|
||||
var config = ConfigSystem.GetConfig<MakeupModel>();
|
||||
if (config != null)
|
||||
{
|
||||
var vo = config.GetData(makeupTaskData.tableId);
|
||||
if (vo != null && ui?.text_level_limit != null)
|
||||
{
|
||||
var stage= vo.levels_need - GameHelper.GetLevel();
|
||||
if(stage <= 0)
|
||||
{
|
||||
stage = 1;
|
||||
}
|
||||
ui.text_level_limit.SetVar("x", stage.ToString()).FlushVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
InitView();
|
||||
|
||||
DOVirtual.DelayedCall(0.7f, () => { GameDispatcher.Instance.Dispatch(GameMsg.reset_game, args); });
|
||||
|
||||
if (AudioManager.Instance.IsOpenEffect)
|
||||
{
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.game_open);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
@@ -85,48 +107,19 @@ namespace ChillConnect
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
//初始化页面逻辑`
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
|
||||
// var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.anim, Fx_Type.fx_open, ref closeCallback);
|
||||
// sk.state.SetAnimation(0, "animation", false);
|
||||
|
||||
|
||||
// DOVirtual.DelayedCall(2.8f, () =>
|
||||
// {
|
||||
// ui.bg.visible = false;
|
||||
// });
|
||||
ui.t0.Play();
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
ui.t0.Play(() =>
|
||||
{
|
||||
// ui.anim.visible = false;
|
||||
if (need_show&&GameHelper.IsGiftSwitch()) {
|
||||
if (GameHelper.IsShowLevelTips())
|
||||
{
|
||||
// ui.tips_node.visible = false;
|
||||
DOVirtual.DelayedCall(0.2f, ()=>{
|
||||
// ui.tips_node.visible = true;
|
||||
var meteor1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tips_node, Fx_Type.fx_tips, ref closeCallback);
|
||||
meteor1.state.SetAnimation(0, "animation", false);
|
||||
meteor1.state.Complete += a =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
};
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
}
|
||||
} else {
|
||||
DOVirtual.DelayedCall(0.4f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
});
|
||||
}
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Close);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user