Exemplo n.º 1
0
 private static IEnumerator _ListScenes()
 {
     /*
      * for (int i = 0; i <= 41; i++) {
      *  SButton button = new SButton($"Scene {i}") {
      *      Alignment = TextAnchor.MiddleLeft,
      *      With = { new SFadeInAnimation() },
      *      OnClick = b => {
      *          SceneManager.LoadScene(int.Parse(b.Text.Substring(6)));
      *      }
      *  };
      *  ScenesGroup.Children.Add(button);
      *  yield return null;
      * }
      */
     using (StreamReader reader = new StreamReader(ModContent.GetMapped("ylmapi/scenes.txt").Stream))
         while (!reader.EndOfStream)
         {
             string line = reader.ReadLine().Trim();
             if (line.Length == 0)
             {
                 continue;
             }
             AddScene(line);
             yield return(null);
         }
 }