private void Awake() { CSharp = EditorPrefs.GetString("cache_protocol_path_c#"); CPP = EditorPrefs.GetString("cache_protocol_path_c++"); Erlang = EditorPrefs.GetString("cache_protocol_path_erlang"); Go = EditorPrefs.GetString("cache_protocol_path_go"); Java = EditorPrefs.GetString("cache_protocol_path_java"); if (string.IsNullOrEmpty(CSharp)) { CSharp = Application.dataPath + "/Protocols/"; } if (string.IsNullOrEmpty(CPP)) { CPP = ProtocolGenerator.LanguageImplemented("C++") ? EditorUtil.GetProjectName(true) + "Protocols/CPP/" : "Language not supported"; } if (string.IsNullOrEmpty(Erlang)) { Erlang = ProtocolGenerator.LanguageImplemented("Erlang") ? EditorUtil.GetProjectName(true) + "Protocols/Erlang/" : "Language not supported"; } if (string.IsNullOrEmpty(Go)) { Go = ProtocolGenerator.LanguageImplemented("Go") ? EditorUtil.GetProjectName(true) + "Protocols/Go/" : "Language not supported"; } if (string.IsNullOrEmpty(Java)) { Java = ProtocolGenerator.LanguageImplemented("Java") ? EditorUtil.GetProjectName(true) + "Protocols/Java/" : "Language not supported"; } }
private void Save() { EditorPrefs.SetString("cache_protocol_path_c#", CSharp); EditorPrefs.SetString("cache_protocol_path_c++", ProtocolGenerator.LanguageImplemented("C++") ? CPP : ""); EditorPrefs.SetString("cache_protocol_path_erlang", ProtocolGenerator.LanguageImplemented("Erlang") ? Erlang : ""); EditorPrefs.SetString("cache_protocol_path_go", ProtocolGenerator.LanguageImplemented("Go") ? Go : ""); EditorPrefs.SetString("cache_protocol_path_java", ProtocolGenerator.LanguageImplemented("Java") ? Java : ""); }