private static void HandleEditorStartedCompiling() { CompileTimeTracker._data.StartTime = TrackingUtil.GetMilliseconds(); UnityConsoleCountsByType countsByType = UnityEditorConsoleUtil.GetCountsByType(); CompileTimeTracker.StoredErrorCount = countsByType.errorCount; }
private static void HandleEditorFinishedCompiling() { int elapsedTime = TrackingUtil.GetMilliseconds() - CompileTimeTracker._data.StartTime; UnityConsoleCountsByType countsByType = UnityEditorConsoleUtil.GetCountsByType(); bool hasErrors = (countsByType.errorCount - CompileTimeTracker.StoredErrorCount) > 0; CompileTimeKeyframe keyframe = new CompileTimeKeyframe(elapsedTime, hasErrors); CompileTimeTracker._data.AddCompileTimeKeyframe(keyframe); CompileTimeTracker.KeyframeAdded.Invoke(keyframe); }
public static UnityConsoleCountsByType GetCountsByType() { UnityConsoleCountsByType countsByType = new UnityConsoleCountsByType(); if (UnityEditorConsoleUtil._getCountsByTypeMethod == null) { Debug.LogError("Failed to find LogEntries.GetCountsByType method info!"); return(countsByType); } object[] arguments = new object[] { 0, 0, 0 }; UnityEditorConsoleUtil._getCountsByTypeMethod.Invoke(null, arguments); countsByType.errorCount = (int)arguments[0]; countsByType.warningCount = (int)arguments[1]; countsByType.logCount = (int)arguments[2]; return(countsByType); }