Beispiel #1
0
        internal static bool OpenFileExternal(string stackTrace)
        {
            CSourcePathEntry element;

            if (CUnityStackTraceParser.TryParse(stackTrace, out element))
            {
                return(CEditor.OpenFileAtLineExternal(element.sourcePath, element.lineNumber));
            }

            return(false);
        }
        private void DrawStackLine(ref CStackTraceLine stackLine, GUIStyle style)
        {
            if (stackLine.IsClickable)
            {
                GUIStyle linkStyle = stackLine.sourcePathExists ? CSharedStyles.consoleLinkStyle : CSharedStyles.consoleLinkInnactiveStyle;
                CUIHelper.DrawUnderLine(stackLine.sourceFrame, linkStyle);

                if (stackLine.sourcePathExists && GUI.Button(stackLine.sourceFrame, GUIContent.none, GUIStyle.none))
                {
                    CEditor.OpenFileAtLineExternal(stackLine.sourcePath, stackLine.lineNumber);
                }
            }
            GUI.Label(stackLine.frame, stackLine.line, style);
        }
        //////////////////////////////////////////////////////////////////////////////

        public override bool OnMouseDoubleClick(CEvent evt)
        {
            if (!string.IsNullOrEmpty(StackTrace))
            {
                if (CEditor.OpenFileExternal(StackTrace))
                {
                    return(true);
                }
            }
            else if (this.LogLevel == CLogLevel.Error || this.LogLevel == CLogLevel.Warn)
            {
                CSourcePathEntry element;
                if (CEditorStackTrace.TryParseCompilerMessage(m_value, out element))
                {
                    if (CEditor.OpenFileAtLineExternal(element.sourcePath, element.lineNumber))
                    {
                        return(true);
                    }
                }
            }

            return(base.OnMouseDoubleClick(evt));
        }