|
- using System;
- using System.Collections.Generic;
- using UnityEngine;
-
- namespace SUISSEngine
- {
- public class Parser
- {
- public static Dictionary<string, string> ParsePropertyFileFormat(string text)
- {
- Dictionary<string, string> dictionary = new Dictionary<string, string>();
- foreach (string text2 in text.Split(new char[]
- {
- '\n'
- }))
- {
- int num = text2.IndexOf('=');
- if (num >= 0)
- {
- string text3 = text2.Substring(0, num).Trim();
- string value = text2.Substring(num + 1).Trim();
- if (dictionary.ContainsKey(text3))
- {
- UnityEngine.Debug.LogWarning(string.Format("Result dictionary already contains key '{0}'", text3));
- }
- dictionary[text3] = value;
- }
- }
- return dictionary;
- }
- }
- }
|