public static void LoadUIHelperConfig(JsonObjectUIHelper helper) { JsonObjectTypeAttribute t = helper.GetType().GetCustomAttributes(typeof(JsonObjectTypeAttribute), false)[0] as JsonObjectTypeAttribute; string conf = EditorPrefs.GetString(string.Format("{0}{1}", ConfStringInterfaceHelperPrefix, t.Type.ToString().ToUpper())); LoadSIConfig(helper, conf); }
//设置当前StringInterface// public void SetCurStringInterface(object si, JsonObjectUIHelper sih) { if (si != m_CurStringInterface || sih != m_CurStringInterfaceHelper) { m_CurStringInterface = si; m_CurStringInterfaceHelper = sih; m_FoldOutMap.Clear(); } }
public static void SaveHelperConfiguration(JsonObjectUIHelper helper) { JsonObjectHelperTypes type = ((JsonObjectTypeAttribute)helper.GetType().GetCustomAttributes(typeof(JsonObjectTypeAttribute), false)[0]).Type; Dictionary <string, string> dic = new Dictionary <string, string>(); helper.OnSaveConfig(dic); System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (KeyValuePair <string, string> i in dic) { sb.Append(string.Format("{0}|{1}\n", i.Key, i.Value)); } EditorPrefs.SetString(string.Format("{0}{1}", ConfStringInterfaceHelperPrefix, type.ToString().ToUpper()), sb.ToString()); }
public GOEEditorMainWindow() { Init(); //mUIHelperMap.Add ("Act", new FireActUIHelper ()); //选中Pack// mCurTypeName = JsonObjectHelperTypes.PackV5; JsonObjectUIHelper helper = Helper; //搜索// //Search(helper.GetSearchDir(), "*" + helper.GetFileExt()); DoSearch(""); }
void LoadSelectedFiles(JsonObjectHelperTypes type, JsonObjectUIHelper helper, string conf) { HashSet <string> files = new HashSet <string>(); string[] f = conf.Split('|'); foreach (string i in f) { if (string.IsNullOrEmpty(i)) { continue; } files.Add(i); } mHelperSelectedFiles[type] = files; }
static void LoadSIConfig(JsonObjectUIHelper helper, string conf) { string[] lines = conf.Split('\n'); Dictionary <string, string> dic = new Dictionary <string, string>(); foreach (string line in lines) { string[] param = line.Split('|'); if (param.Length == 2) { dic[param[0]] = param[1]; } } helper.OnLoadConfig(dic); }
//设置当前StringInterface// public void SetCurStringInterface(object si, JsonObjectUIHelper sih) { mCurStringInterface = si; mCurStringInterfaceHelper = sih; }