fix new live error, add live Lyrics ui

This commit is contained in:
CroakFang
2023-08-28 00:57:47 +08:00
parent 3cbe760b84
commit 070b005216
16 changed files with 698 additions and 198 deletions
+15 -1
View File
@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using UnityEngine;
public class UmaUtility
public static class UmaUtility
{
public static Dictionary<string, Transform> ConvertListToDictionary(List<Transform> transformList)
{
@@ -55,5 +55,19 @@ public class UmaUtility
JsonUtility.FromJsonOverwrite(json, to);
}
public static string GetCurrentLyrics(float time, List<UmaLyricsData> lyricsDatas)
{
for (int i = lyricsDatas.Count - 1; i >= 0; i--)
{
if (lyricsDatas[i].time < time)
{
var lyric = lyricsDatas[i].text;
lyric = lyric.Replace("[COMMA]", ",");
lyric = lyric.Replace("\\n", "\n");
return lyric;
}
}
return "";
}
}