aeroson

Untitled

Nov 17th, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. public class MailCollectionDataLoader : MonoBehaviour {
  8.  
  9.  
  10. public static List<string> allMailCategories = new List<string>();
  11.  
  12. //load all mail definition
  13.  
  14. string[] pathToFiles = new string[0];
  15.  
  16. MailContainer[] mcs = new MailContainer[2];
  17.  
  18. void Start () {
  19.  
  20. pathToFiles = new string[2] {"spammails","privatemails"};
  21.  
  22. for (int i = 0; i < pathToFiles.Length; i++) {
  23.  
  24. mcs [i] = MailContainer.Load (pathToFiles [i]);
  25. }
  26.  
  27. allMailCategories.Clear();
  28. for (int i = 0; i < mcs.Length; i++) {
  29.  
  30. foreach (Mail mail in mcs[i].Mails) {
  31.  
  32. allMailCategories.Add (mail.category);
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment