fix incorrect log references

This commit is contained in:
bd_ 2023-02-28 23:22:05 +09:00
parent 42f1fcfd59
commit 4f5feeb1b9
2 changed files with 7 additions and 4 deletions

View File

@ -293,7 +293,8 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
internal static void Log(ReportLevel level, string code, object[] strings, params Object[] objects) internal static void Log(ReportLevel level, string code, object[] strings, params Object[] objects)
{ {
ErrorLog errorLog = new ErrorLog(level, code, strings, objects); ErrorLog errorLog =
new ErrorLog(level, code, strings: strings.Select(s => s.ToString()).ToArray(), objects);
var avatarReport = CurrentReport._currentAvatar; var avatarReport = CurrentReport._currentAvatar;
if (avatarReport == null) if (avatarReport == null)
@ -307,7 +308,7 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
internal static void LogFatal(string code, object[] strings, params Object[] objects) internal static void LogFatal(string code, object[] strings, params Object[] objects)
{ {
Log(ReportLevel.Error, code, strings, objects); Log(ReportLevel.Error, code, strings: strings, objects: objects);
if (CurrentReport._currentAvatar != null) if (CurrentReport._currentAvatar != null)
{ {
CurrentReport._currentAvatar.successful = false; CurrentReport._currentAvatar.successful = false;

View File

@ -358,8 +358,10 @@ namespace nadena.dev.modular_avatar.core.editor
var defaultItems = items.Where(i => i.isDefault).ToList(); var defaultItems = items.Where(i => i.isDefault).ToList();
if (defaultItems.Count > 1) if (defaultItems.Count > 1)
{ {
BuildReport.LogFatal("animation_gen.multiple_defaults", Array.Empty<object>(), BuildReport.LogFatal("animation_gen.multiple_defaults",
defaultItems.ToArray<UnityEngine.Object>()); strings: Array.Empty<object>(),
objects: defaultItems.ToArray<UnityEngine.Object>()
);
defaultItems.RemoveRange(1, defaultItems.Count - 1); defaultItems.RemoveRange(1, defaultItems.Count - 1);
} }