示例#1
0
        // This log item is clicked, show the debug entry's stack trace
        public void OnPointerClick(PointerEventData eventData)
        {
#if UNITY_EDITOR
            if (eventData.button == PointerEventData.InputButton.Right)
            {
                Match regex = Regex.Match(logEntry.stackTrace, @"\(at .*\.cs:[0-9]+\)$", RegexOptions.Multiline);
                if (regex.Success)
                {
                    string     line          = logEntry.stackTrace.Substring(regex.Index + 4, regex.Length - 5);
                    int        lineSeparator = line.IndexOf(':');
                    MonoScript script        = AssetDatabase.LoadAssetAtPath <MonoScript>(line.Substring(0, lineSeparator));
                    if (script != null)
                    {
                        AssetDatabase.OpenAsset(script, int.Parse(line.Substring(lineSeparator + 1)));
                    }
                }
            }
            else
            {
                manager.OnLogItemClicked(this);
            }
#else
            manager.OnLogItemClicked(this);
#endif
        }
示例#2
0
 // This log item is clicked, show the debug entry's stack trace
 public void Clicked()
 {
     manager.OnLogItemClicked(this);
 }