aeroson

Untitled

Nov 17th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System.Linq;
  2. using System.Collections.Generic;
  3.  
  4.  
  5. public class MailCollectionDataLoader : MonoBehaviour {
  6.  
  7.  
  8. public static IEnumerable<string> allMailCategories = new string[0];
  9.  
  10. //load all mail definition
  11.  
  12. string[] pathToFiles = new string[0];
  13.  
  14. MailContainer[] mcs = new MailContainer[2];
  15.  
  16. void Start () {
  17.  
  18. pathToFiles = new string[2] {"spammails","privatemails"};
  19.  
  20. for (int i = 0; i < pathToFiles.Length; i++) {
  21.  
  22. mcs [i] = MailContainer.Load (pathToFiles [i]);
  23. }
  24.  
  25. allMailCategories = mcs.SelectMany(ms=>ms.Mails).SelectMany(m=>m.category).ToArray();
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment