fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using DG.Tweening;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
using System.Collections;
|
||||
using FairyGUI;
|
||||
@@ -11,11 +11,10 @@ namespace FlowerPower
|
||||
{
|
||||
private LoadingUICtrl ctrl;
|
||||
private LoadingModel model;
|
||||
private FGUI.PLoading.com_loading ui;
|
||||
private FGUI.ZM_Loading_25.com_loading ui;
|
||||
|
||||
protected GProgressBar pb_loading;
|
||||
private Tweener tweener;
|
||||
private bool loading = false;
|
||||
|
||||
|
||||
protected int currValue;
|
||||
@@ -28,7 +27,7 @@ namespace FlowerPower
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "PLoading";
|
||||
uiInfo.packageName = "ZM_Loading_25";
|
||||
uiInfo.assetName = "com_loading";
|
||||
uiInfo.layerType = UILayerType.Loading;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
@@ -44,11 +43,12 @@ namespace FlowerPower
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
tweener.Kill();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.PLoading.com_loading;
|
||||
ui = baseUI as FGUI.ZM_Loading_25.com_loading;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
@@ -56,26 +56,14 @@ namespace FlowerPower
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenBgUI_Open);
|
||||
ui.com_pb.max = 100;
|
||||
ui.com_pb.value = 0;
|
||||
|
||||
// if (!GameHelper.IsConnect())
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
CrazyAsyKit.StartCoroutine(SetProgress());
|
||||
|
||||
// var splashCanvas = GameObject.Find("SplashCanvas");
|
||||
// if (splashCanvas != null)
|
||||
// {
|
||||
// splashCanvas.SetActive(false);
|
||||
// Object.Destroy(splashCanvas);
|
||||
// }
|
||||
}
|
||||
|
||||
public IEnumerator SetProgress()
|
||||
{
|
||||
tweener = DOTween.To(() => ui.com_pb.value,
|
||||
x => ui.com_pb.value = x, 97, 12.0f);
|
||||
x => ui.com_pb.value = x, 98, 12.0f);
|
||||
|
||||
yield return tweener;
|
||||
}
|
||||
@@ -97,7 +85,6 @@ namespace FlowerPower
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UpdateHotFixMax, OnUpdateHotFixMax);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.UpdateHotFixProgress, OnUpdateHotFixProgress);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Network_reconnection, Reconnection);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.CloseMask, closeMask);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
@@ -105,23 +92,21 @@ namespace FlowerPower
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateHotFixMax, OnUpdateHotFixMax);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UpdateHotFixProgress, OnUpdateHotFixProgress);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Network_reconnection, Reconnection);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.CloseMask, closeMask);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void closeMask(object a = null)
|
||||
{
|
||||
ui.com_pb.visible = true;
|
||||
OnUpdateHotFixProgress(97);
|
||||
}
|
||||
|
||||
private bool isAgree = true;
|
||||
|
||||
public void CheckAgree()
|
||||
{
|
||||
if (!isAgree) return;
|
||||
ctrl.CloseUI();
|
||||
tweener.Kill();
|
||||
tweener = DOTween.To(() => ui.com_pb.value,
|
||||
x => ui.com_pb.value = x, 100, 0.1f).OnComplete(() =>
|
||||
{
|
||||
if (!isAgree) return;
|
||||
ctrl.CloseUI();
|
||||
});
|
||||
}
|
||||
|
||||
private void OnUpdateHotFixMax(object obj)
|
||||
@@ -129,24 +114,17 @@ namespace FlowerPower
|
||||
if (obj != null)
|
||||
{
|
||||
var max = (int)obj;
|
||||
// ui.pb_loading.max = max;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUpdateHotFixProgress(object obj)
|
||||
{
|
||||
if (loading) return;
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
loading = true;
|
||||
tweener.Kill();
|
||||
var value = (int)obj;
|
||||
tweener = DOTween.To(() => ui.com_pb.value,
|
||||
x => ui.com_pb.value = x, value, 12f)
|
||||
.OnUpdate(() =>
|
||||
{
|
||||
ui.com_pb.title.text = (int)(ui.com_pb.value) + "%";
|
||||
});
|
||||
pb_loading.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user