|
@@ -1,5 +1,6 @@
|
|
|
using FairyGUI;
|
|
|
using UI.Loading;
|
|
|
+using Unity.Plastic.Antlr3.Runtime;
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace GFGGame
|
|
@@ -51,7 +52,6 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();//1;//
|
|
|
SetProgress(0);
|
|
|
- _ui.m_txtDescLeft.text = "正在进入游戏";
|
|
|
int index = Random.Range(0, resNames.Length);
|
|
|
_ui.m_loaBg.url = string.Format("ui://Loading/{0}", resNames[index]);
|
|
|
}
|
|
@@ -62,6 +62,22 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
+ /// 设置描述文字
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="desc"></param>
|
|
|
+ public void SetDesc(string desc, string descRight = "")
|
|
|
+ {
|
|
|
+ if (!ViewManager.isViewOpen(typeof(LoadingView).Name))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ string str = string.Format("{0} {1}", desc, descRight);// + descRight;
|
|
|
+ _ui.m_txtDescLeft.text = str;
|
|
|
+ // _ui.m_txtDescLeft.text = desc ?? "";
|
|
|
+ // _ui.m_txtDescRight.text = descRight ?? "";
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
/// 设置进度0-100
|
|
|
/// </summary>
|
|
|
/// <param name="progress"></param>
|
|
@@ -72,12 +88,17 @@ namespace GFGGame
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ double oldValule;
|
|
|
GTweener twener = GTween.GetTween(_ui.m_progressBar1, TweenPropType.Progress);
|
|
|
if (twener != null)
|
|
|
{
|
|
|
- twener.Kill(true);
|
|
|
+ oldValule = twener.value.d;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ oldValule = _ui.m_progressBar1.value;
|
|
|
}
|
|
|
- if (progress < _ui.m_progressBar1.value)
|
|
|
+ if (progress < oldValule)
|
|
|
{
|
|
|
_ui.m_progressBar1.value = progress;
|
|
|
_ui.m_imgAni.x = _ui.m_progressBar1.width * (progress / 100) - 120;
|
|
@@ -85,8 +106,8 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- float duration = (float)(progress - _ui.m_progressBar1.value) * SPEED;
|
|
|
|
|
|
+ float duration = (float)(progress - oldValule) * SPEED;
|
|
|
GTweener gtweener = _ui.m_progressBar1.TweenValue(progress, duration).OnUpdate((GTweener t) =>
|
|
|
{
|
|
|
_ui.m_imgAni.x = _ui.m_progressBar1.width * (t.value.x / 100) - 120;
|