Exemplo n.º 1
0
        public static List <StackTraceItem> ExtractStackTraceItems(string stackTrace)
        {
            var    list   = new List <StackTraceItem>();
            string filter = @"(.*)\ \(at (.+):(\d+)";

            Regex regex   = new Regex(filter);
            var   matches = regex.Matches(stackTrace);

            foreach (Match match in matches)
            {
                var item = new StackTraceItem();
                item.methodName = match.Groups[1].Value;
                item.path       = match.Groups[2].Value;
                item.lineNumber = int.Parse(match.Groups[3].Value);
                item.fileName   = GetFirstFileName(item.path);
                list.Add(item);
            }
            return(list);
        }
Exemplo n.º 2
0
        void DrawStackTraceItem(StackTraceItem item)
        {
            var style = EditorStyles.helpBox;

            style.alignment        = TextAnchor.MiddleLeft;
            style.richText         = true;
            style.normal.textColor = Color.black;

            content.text = item.methodName + "\n<color=#808000ff>" + item.fileName + ":" + item.lineNumber + "</color>";
            //content.text = "<size=30>Some <color=yellow>RICH</color> text</size>";

            if (GUILayout.Button(content, style, GUILayout.ExpandWidth(true)))
            {
                if ((EditorApplication.timeSinceStartup - clickTime) < doubleClickTime)
                {
                    OnStackDoubleClick(item);
                }
                clickTime = EditorApplication.timeSinceStartup;
            }
        }
Exemplo n.º 3
0
 void OnStackDoubleClick(StackTraceItem item)
 {
     EditorTools.OpenScript(item.path, item.lineNumber);
 }