private int GetInterestingFrameIndex(StackFrame[] stacktrace)
 {
     string dataPath = Application.dataPath;
     int num = -1;
     for (int i = 0; i < stacktrace.Length; i++)
     {
         StackFrame frame = stacktrace[i];
         if ((!string.IsNullOrEmpty(frame.sourceFile) && !frame.signature.StartsWith("UnityEngine.GUIDebugger")) && !frame.signature.StartsWith("UnityEngine.GUILayoutUtility"))
         {
             if (num == -1)
             {
                 num = i;
             }
             if (frame.sourceFile.StartsWith(dataPath))
             {
                 return i;
             }
         }
     }
     if (num != -1)
     {
         return num;
     }
     return (stacktrace.Length - 1);
 }
 protected string GetInstructionListName(StackFrame[] stacktrace)
 {
     int interestingFrameIndex = this.GetInterestingFrameIndex(stacktrace);
     if (interestingFrameIndex > 0)
     {
         interestingFrameIndex--;
     }
     StackFrame frame = stacktrace[interestingFrameIndex];
     return frame.methodName;
 }
 private int GetInterestingFrameIndex(StackFrame[] stacktrace)
 {
   string dataPath = Application.dataPath;
   int num = -1;
   for (int index = 0; index < stacktrace.Length; ++index)
   {
     StackFrame stackFrame = stacktrace[index];
     if (!string.IsNullOrEmpty(stackFrame.sourceFile) && !stackFrame.signature.StartsWith("UnityEngine.GUI") && !stackFrame.signature.StartsWith("UnityEditor.EditorGUI"))
     {
       if (num == -1)
         num = index;
       if (stackFrame.sourceFile.StartsWith(dataPath))
         return index;
     }
   }
   if (num != -1)
     return num;
   return stacktrace.Length - 1;
 }
 private string GetInstructionListName(StackFrame[] stacktrace)
 {
   int interestingFrameIndex = this.GetInterestingFrameIndex(stacktrace);
   if (interestingFrameIndex > 0)
     --interestingFrameIndex;
   return stacktrace[interestingFrameIndex].methodName;
 }
 private void ShowInstructionInExternalEditor(StackFrame[] frames)
 {
     int interestingFrameIndex = this.GetInterestingFrameIndex(frames);
     StackFrame frame = frames[interestingFrameIndex];
     InternalEditorUtility.OpenFileAtLineExternal(frame.sourceFile, (int) frame.lineNumber);
 }
예제 #6
0
 protected void DrawStackFrameList(StackFrame[] stackframes)
 {
     if (stackframes != null)
     {
         foreach (StackFrame frame in stackframes)
         {
             if (!string.IsNullOrEmpty(frame.sourceFile))
             {
                 GUILayout.Label(string.Format("{0} [{1}:{2}]", frame.signature, frame.sourceFile, frame.lineNumber), GUIViewDebuggerWindow.s_Styles.stackframeStyle, new GUILayoutOption[0]);
             }
         }
     }
 }