public void OneTimeSetUp() { var discovery = new Mock <IDiscovery>(); var generator = new Mock <IGenerator>(); editor = new VSCodeScriptEditor(discovery.Object, generator.Object); }
public static void Register(IExternalCodeEditor externalCodeEditor) { if (Editor.m_ExternalCodeEditors.Select(editor => editor.GetType()).Where(editorType => editorType == externalCodeEditor.GetType()).Any()) { return; } Editor.m_ExternalCodeEditors.Add(externalCodeEditor); }
public static void Register(IExternalCodeEditor externalCodeEditor) { if (Editor.m_ExternalCodeEditors.Select(editor => editor.GetType()).Any(editorType => editorType == externalCodeEditor.GetType())) { return; } Editor.m_ExternalCodeEditors.Add(externalCodeEditor); CodeEditor.Editor.SetCodeEditor(Editor.m_CurrentInstallation.Path); }
public void SetCodeEditor(string editorPath) { if (editorPath == null) { throw new ArgumentException("SetCodeEditor: Does not allow null editorPath"); } EditorPrefs.SetString("kScriptsDefaultApp", editorPath); m_CurrentEditor = ComputeCurrentEditor(editorPath); m_CurrentInstallation = GetInstallationForPath(editorPath); m_CurrentEditor.Initialize(editorPath); }
public static void SendCodeEditorUsage(IExternalCodeEditor codeEditor) { if (!UnityEngine.Analytics.Analytics.enabled) { return; } if (!EnableAnalytics()) { return; } var data = new AnalyticsData() { code_editor = codeEditor.GetType().FullName }; EditorAnalytics.SendEventWithLimit(k_EventName, data); }
private IExternalCodeEditor ComputeCurrentEditor(string editorPath) { if (m_ExternalCodeEditors.Count() == 0) { TypeCollection collection = TypeCache.GetTypesDerivedFrom <IExternalCodeEditor>(); for (int i = 0; i < collection.Count(); i++) { var codeEditorType = collection[i]; if (codeEditorType == typeof(DefaultExternalCodeEditor)) { continue; } if (codeEditorType.GetConstructor(BindingFlags.Public | BindingFlags.Instance, null, Type.EmptyTypes, null) != null) { IExternalCodeEditor codeEditor = (IExternalCodeEditor)Activator.CreateInstance(codeEditorType); m_ExternalCodeEditors.Add(codeEditor); } } } return(GetCodeEditorForPath(editorPath)); }
public CodeEditor() { m_CurrentEditor = m_DefaultEditor; m_CurrentInstallation = GetInstallationForPath(CurrentEditorPath); }
public static void Unregister(IExternalCodeEditor externalCodeEditor) { Editor.m_ExternalCodeEditors.Remove(externalCodeEditor); CodeEditor.Editor.SetCodeEditor(Editor.m_CurrentInstallation.Path); }
public static void Unregister(IExternalCodeEditor externalCodeEditor) { Editor.m_ExternalCodeEditors.Remove(externalCodeEditor); }
public static void Register(IExternalCodeEditor externalCodeEditor) { Editor.m_ExternalCodeEditors.Add(externalCodeEditor); }