static NGDiagnostic() { if (NGDiagnostic.IsInDiagnostic() == true) { Utility.SafeDelayCall(() => EditorUtility.DisplayProgressBar(Constants.PackageTitle, "Diagnosing...", 6F / 7F)); Utility.RegisterIntervalCallback(NGDiagnostic.PrepareResult, 100); } }
public static void DelayDiagnostic(Action callback) { if (NGDiagnostic.IsInDiagnostic() == false) { return; } NGDiagnostic.diagnosis.Push(callback); }
public static void Log(string group, string key, object content) { if (NGDiagnostic.IsInDiagnostic() == false) { return; } if (Conf.DebugMode == Conf.DebugState.Verbose) { Debug.Log("[" + group + "] " + key + "=" + content); } List <KeyValuePair <string, string> > logs; if (NGDiagnostic.logs.TryGetValue(group, out logs) == false) { logs = new List <KeyValuePair <string, string> >(); NGDiagnostic.logs.Add(group, logs); } if (content == null) { logs.Add(new KeyValuePair <string, string>(key, "null")); } else { logs.Add(new KeyValuePair <string, string>(key, content.ToString())); } int totalLogs = 0; foreach (var l in NGDiagnostic.logs) { totalLogs += l.Value.Count; } EditorApplication.delayCall += () => EditorUtility.DisplayProgressBar(Constants.PackageTitle, "Diagnosing... (" + totalLogs + " / " + NGDiagnostic.logs.Count + ")", 6F / 7F); }