using System.Text; namespace SinMaiLauncher { public static class TextAnimation { public static IEnumerable LoadingTextSeq(int len) { IReadOnlyCollection sym = ['甲', '申', '由', '申']; const char padding = '.'; var symEnu = Loop(sym).GetEnumerator(); while (true) { var sb = new StringBuilder(); for (int i = 0; i < len; i++) { symEnu.MoveNext(); sb.Clear(); sb.Append(symEnu.Current); for (int j = 0; j < i; j++) sb.Append(padding); yield return sb.ToString(); } } } private static IEnumerable Loop(IEnumerable source) { while (true) { foreach (var item in source) { yield return item; } } } } }