Ejemplo n.º 1
0
        private static bool OpenProject(string path, int line, int column)
        {
            var didOpenProject = Editor.CurrentCodeEditor.OpenProject(path, line, column);

            if (didOpenProject)
            {
                CodeEditorAnalytics.SendCodeEditorUsage(CodeEditor.Editor.CurrentCodeEditor);
            }
            return(didOpenProject);
        }
Ejemplo n.º 2
0
        private static bool OnOpenAsset(int instanceID, int line, int column)
        {
            var selected  = EditorUtility.InstanceIDToObject(instanceID);
            var assetPath = AssetDatabase.GetAssetPath(selected);

            if (string.IsNullOrEmpty(assetPath))
            {
                return(false);
            }

            var assetFilePath  = Path.GetFullPath(assetPath);
            var didOpenProject = Editor.CurrentCodeEditor.OpenProject(assetFilePath, line, column);

            if (didOpenProject)
            {
                CodeEditorAnalytics.SendCodeEditorUsage(CodeEditor.Editor.CurrentCodeEditor);
            }
            return(didOpenProject);
        }