简单代码
void ProcessingData(List<string> dataList)
{
for (int i = 0; i < dataList.Count; i++)
{
string[] strarry = dataList[i].Split(new char[] { '[', ']' });
if (strarry != null && strarry.Length > 0)
{
for (int j = 1; j < strarry.Length; j++)
{
string tempstr = strarry[j];
if (tempstr.StartsWith("ti") || tempstr.StartsWith("ar") || tempstr.StartsWith("al") || tempstr.StartsWith("by") || tempstr.StartsWith("offset"))
{
string[] strarry1 = tempstr.Split(':');
}
else
{
if (tempstr.Contains(":"))
{
string[] strarry1 = tempstr.Split(':');
float m = float.Parse(strarry1[0]) * 60;
float s = float.Parse(strarry1[1]);
floattimelist.Add(m + s);
}
else
{
stringlyriclist.Add(tempstr);
}
}
}
}
}
}
void ShowLrc(int index)
{
if (index >= stringlyriclist.Count / 4)
{
temp -= offest;
if (temp >= 0)
{
ScrollRect.verticalNormalizedPosition = temp;
Debug.Log(temp);
}
}
texts[index].color = Color.green;
if (index > 0 && index < stringlyriclist.Count)
{
texts[index - 1].color = Color.gray;
}
}