loading页面Tips调整&骑行卡顿问题解决
This commit is contained in:
1 parent
0628bd3716
commit
43dc844998
4 files changed
+18
-23
No files matched your search
@@ -11,17 +11,17 @@ public class MultiTips:PFUIText
|
||||
private Button button;
|
||||
private string[] tips { get; set; }
|
||||
private int currentIndex = 0;
|
||||
|
||||
private System.Random random;
|
||||
new void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
text = GetComponent<Text>();
|
||||
var tiplist = ConfigHelper.mapApi.GetTipsList();
|
||||
if (!string.IsNullOrEmpty(tiplist))
|
||||
var result = ConfigHelper.mapApi.GetTipsList();
|
||||
if (result.result)
|
||||
{
|
||||
tips = tiplist.Split('#');
|
||||
tips = result.data.ToArray();
|
||||
}
|
||||
var random = new System.Random();
|
||||
random = new System.Random();
|
||||
currentIndex = random.Next(0, tips.Length);
|
||||
SetText();
|
||||
}
|
||||
@@ -32,21 +32,14 @@ public class MultiTips:PFUIText
|
||||
}
|
||||
public void SetText()
|
||||
{
|
||||
if(text == null)
|
||||
if(text == null || tips.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
currentIndex = random.Next(0, tips.Length);
|
||||
if (currentIndex <= tips.Length)
|
||||
{
|
||||
text.text = tips[currentIndex];
|
||||
if (currentIndex + 1 < tips.Length)
|
||||
{
|
||||
currentIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
float time = 10f;
|
||||
|
||||
Reference in new issue
Block a user