|
@@ -8,11 +8,13 @@ namespace GFGGame
|
|
|
{
|
|
|
|
|
|
private UI_LoadingView _ui;
|
|
|
-
|
|
|
- private const float SPEED = 0.005f;
|
|
|
+ //每个进度需要的时间,单位为毫秒
|
|
|
+ private const float TimePerProgress = 0.005f;
|
|
|
private string[] resNames = { "11", "33" };
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
|
+ //每个进度需要的时间,单位为毫秒
|
|
|
+ private float timePerProgress;
|
|
|
|
|
|
private static LoadingView m_Instance = null;
|
|
|
|
|
@@ -57,6 +59,14 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();//1;//
|
|
|
SetProgress(0);
|
|
|
+ if(this.viewData != null)
|
|
|
+ {
|
|
|
+ timePerProgress = (float)this.viewData;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ timePerProgress = TimePerProgress;
|
|
|
+ }
|
|
|
int index = Random.Range(0, resNames.Length);
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath(resNames[index]);
|
|
|
|
|
@@ -113,7 +123,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- float duration = (float)(progress - oldValule) * SPEED;
|
|
|
+ float duration = (float)(progress - oldValule) * timePerProgress;
|
|
|
GTweener gtweener = _ui.m_progressBar1.TweenValue(progress, duration).OnUpdate((GTweener t) =>
|
|
|
{
|
|
|
float posX = _ui.m_progressBar1.width * (t.value.x / 100) + _ui.m_progressBar1.x;
|