Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

33 řádky
782 B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace SUISSEngine
  5. {
  6. public class Parser
  7. {
  8. public static Dictionary<string, string> ParsePropertyFileFormat(string text)
  9. {
  10. Dictionary<string, string> dictionary = new Dictionary<string, string>();
  11. foreach (string text2 in text.Split(new char[]
  12. {
  13. '\n'
  14. }))
  15. {
  16. int num = text2.IndexOf('=');
  17. if (num >= 0)
  18. {
  19. string text3 = text2.Substring(0, num).Trim();
  20. string value = text2.Substring(num + 1).Trim();
  21. if (dictionary.ContainsKey(text3))
  22. {
  23. UnityEngine.Debug.LogWarning(string.Format("Result dictionary already contains key '{0}'", text3));
  24. }
  25. dictionary[text3] = value;
  26. }
  27. }
  28. return dictionary;
  29. }
  30. }
  31. }