포매팅

This commit is contained in:
2026-02-01 19:42:47 +09:00
parent e4566118f7
commit 793e544eb0
4 changed files with 1331 additions and 1333 deletions

View File

@@ -1,4 +1,4 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.AutoMorpherLogCollector // Eden.AutoMorpher.AutoMorpherLogCollector
@@ -6,135 +6,134 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Eden.AutoMorpher;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
public class AutoMorpherLogCollector public class AutoMorpherLogCollector
{ {
private struct LogEntry private struct LogEntry
{ {
public DateTime utcTime; public DateTime utcTime;
public LogType type; public LogType type;
public string condition; public string condition;
public string stackTrace; public string stackTrace;
} }
private bool _isCapturing; private bool _isCapturing;
private DateTime _captureStartUtc; private DateTime _captureStartUtc;
private readonly List<LogEntry> _entries = new List<LogEntry>(2048); private readonly List<LogEntry> _entries = new List<LogEntry>(2048);
private int entriesCapacity = 5000; private int entriesCapacity = 5000;
private const string logSavePath = "Assets/@Eden_Tools/Eden_AutoMorpher/Logs"; private const string logSavePath = "Assets/@Eden_Tools/Eden_AutoMorpher/Logs";
public void BeginCapture() public void BeginCapture()
{ {
if (!_isCapturing) if (!this._isCapturing)
{ {
_isCapturing = true; this._isCapturing = true;
_entries.Clear(); this._entries.Clear();
_captureStartUtc = DateTime.UtcNow; this._captureStartUtc = DateTime.UtcNow;
Application.logMessageReceived += OnLogMessageReceived; Application.logMessageReceived += this.OnLogMessageReceived;
} }
} }
public void EndCapture() public void EndCapture()
{ {
if (_isCapturing) if (this._isCapturing)
{ {
_isCapturing = false; this._isCapturing = false;
Application.logMessageReceived -= OnLogMessageReceived; Application.logMessageReceived -= this.OnLogMessageReceived;
} }
} }
public string SaveToTextFile(string defaultFileName, bool includeWarningsAndInfo) public string SaveToTextFile(string defaultFileName, bool includeWarningsAndInfo)
{ {
EnsureLogDirectoryExists(); this.EnsureLogDirectoryExists();
string text = defaultFileName; string text = defaultFileName;
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
{ {
text = "EdenAutoMorpher_Report.txt"; text = "EdenAutoMorpher_Report.txt";
} }
if (!text.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)) if (!text.EndsWith(".txt", StringComparison.OrdinalIgnoreCase))
{ {
text += ".txt"; text += ".txt";
} }
string text2 = Path.Combine("Assets/@Eden_Tools/Eden_AutoMorpher/Logs", text); string text2 = Path.Combine("Assets/@Eden_Tools/Eden_AutoMorpher/Logs", text);
string contents = BuildReportText(includeWarningsAndInfo); string contents = this.BuildReportText(includeWarningsAndInfo);
File.WriteAllText(text2, contents, Encoding.UTF8); File.WriteAllText(text2, contents, Encoding.UTF8);
AssetDatabase.Refresh(); AssetDatabase.Refresh();
Debug.Log("[AutoMorpher] Log report saved: " + text2); Debug.Log("[AutoMorpher] Log report saved: " + text2);
return text2; return text2;
} }
private void EnsureLogDirectoryExists() private void EnsureLogDirectoryExists()
{ {
if (AssetDatabase.IsValidFolder("Assets/@Eden_Tools/Eden_AutoMorpher/Logs")) if (AssetDatabase.IsValidFolder("Assets/@Eden_Tools/Eden_AutoMorpher/Logs"))
{ {
return; return;
} }
string[] array = "Assets/@Eden_Tools/Eden_AutoMorpher/Logs".Split('/', StringSplitOptions.None); string[] array = "Assets/@Eden_Tools/Eden_AutoMorpher/Logs".Split('/', StringSplitOptions.None);
string text = array[0]; string text = array[0];
for (int i = 1; i < array.Length; i++) for (int i = 1; i < array.Length; i++)
{ {
string text2 = text + "/" + array[i]; string text2 = text + "/" + array[i];
if (!AssetDatabase.IsValidFolder(text2)) if (!AssetDatabase.IsValidFolder(text2))
{ {
AssetDatabase.CreateFolder(text, array[i]); AssetDatabase.CreateFolder(text, array[i]);
} }
text = text2; text = text2;
} }
} }
public string BuildReportText(bool includeWarningsAndInfo) public string BuildReportText(bool includeWarningsAndInfo)
{ {
StringBuilder stringBuilder = new StringBuilder(65536); StringBuilder stringBuilder = new StringBuilder(65536);
stringBuilder.AppendLine("==== EDEN AUTO MORPHER LOG REPORT ===="); stringBuilder.AppendLine("==== EDEN AUTO MORPHER LOG REPORT ====");
stringBuilder.AppendLine($"Captured (UTC) : {_captureStartUtc:yyyy-MM-dd HH:mm:ss} ~ {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}"); stringBuilder.AppendLine($"Captured (UTC) : {this._captureStartUtc:yyyy-MM-dd HH:mm:ss} ~ {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss}");
stringBuilder.AppendLine("Unity Version : " + Application.unityVersion); stringBuilder.AppendLine("Unity Version : " + Application.unityVersion);
stringBuilder.AppendLine($"Platform : {Application.platform}"); stringBuilder.AppendLine($"Platform : {Application.platform}");
stringBuilder.AppendLine("Project : " + Application.productName); stringBuilder.AppendLine("Project : " + Application.productName);
stringBuilder.AppendLine(); stringBuilder.AppendLine();
stringBuilder.AppendLine("---- Logs ----"); stringBuilder.AppendLine("---- Logs ----");
for (int i = 0; i < _entries.Count; i++) for (int i = 0; i < this._entries.Count; i++)
{ {
LogEntry logEntry = _entries[i]; LogEntry logEntry = this._entries[i];
if (includeWarningsAndInfo || logEntry.type == LogType.Error || logEntry.type == LogType.Assert || logEntry.type == LogType.Exception) if (includeWarningsAndInfo || logEntry.type == LogType.Error || logEntry.type == LogType.Assert || logEntry.type == LogType.Exception)
{ {
stringBuilder.AppendLine($"[{i:0000}] - [{logEntry.type}] | {logEntry.utcTime:HH:mm:ss.fff} UTC"); stringBuilder.AppendLine($"[{i:0000}] - [{logEntry.type}] | {logEntry.utcTime:HH:mm:ss.fff} UTC");
stringBuilder.AppendLine(logEntry.condition ?? string.Empty); stringBuilder.AppendLine(logEntry.condition ?? string.Empty);
if (!string.IsNullOrEmpty(logEntry.stackTrace)) if (!string.IsNullOrEmpty(logEntry.stackTrace))
{ {
stringBuilder.AppendLine("Details:"); stringBuilder.AppendLine("Details:");
stringBuilder.AppendLine(logEntry.stackTrace); stringBuilder.AppendLine(logEntry.stackTrace);
} }
stringBuilder.AppendLine(); stringBuilder.AppendLine();
} }
} }
return stringBuilder.ToString(); return stringBuilder.ToString();
} }
private void OnLogMessageReceived(string condition, string stackTrace, LogType type) private void OnLogMessageReceived(string condition, string stackTrace, LogType type)
{ {
if (_isCapturing) if (this._isCapturing)
{ {
_entries.Add(new LogEntry this._entries.Add(new LogEntry
{ {
utcTime = DateTime.UtcNow, utcTime = DateTime.UtcNow,
type = type, type = type,
condition = condition, condition = condition,
stackTrace = stackTrace stackTrace = stackTrace
}); });
if (_entries.Count > entriesCapacity) if (this._entries.Count > this.entriesCapacity)
{ {
_entries.RemoveRange(0, 1000); this._entries.RemoveRange(0, 1000);
} }
} }
} }
} }

View File

@@ -1,304 +1,304 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.AutoMorpherValidator // Eden.AutoMorpher.AutoMorpherValidator
using System.Text;
using Eden.AutoMorpher; using Eden.AutoMorpher;
using System.Text;
using UnityEngine; using UnityEngine;
public class AutoMorpherValidator public class AutoMorpherValidator
{ {
public bool ValidateAutoModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateAutoModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateAutoModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage); return this.ValidateAutoModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateManualMode_AutoSetup_Objects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateManualMode_AutoSetup_Objects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateManualMode_AutoSetup_Objects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage); return this.ValidateManualMode_AutoSetup_Objects_Internal(sourceAvatar, sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateManualModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage) public bool ValidateManualModeObjects(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage)
{ {
return ValidateManualModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage); return this.ValidateManualModeObjects_Internal(sourceAvatar, sourceClothes, targetAvatar, targetClothes, out errorMessage);
} }
public bool ValidateProfileModeObjects(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateProfileModeObjects(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
return ValidateProfileModeObjects_Internal(sourceClothes, targetAvatar, out errorMessage); return this.ValidateProfileModeObjects_Internal(sourceClothes, targetAvatar, out errorMessage);
} }
public bool ValidateAutoModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateAutoModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
errorMessage = null; errorMessage = null;
return true; return true;
} }
errorMessage = "Auto Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString(); errorMessage = "Auto Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString();
return false; return false;
} }
public bool ValidateProfileModeObjects_Internal(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateProfileModeObjects_Internal(GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
errorMessage = null; errorMessage = null;
return true; return true;
} }
errorMessage = "Profile Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString(); errorMessage = "Profile Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString();
return false; return false;
} }
public bool ValidateManualMode_AutoSetup_Objects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage) public bool ValidateManualMode_AutoSetup_Objects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
errorMessage = null; errorMessage = null;
return true; return true;
} }
errorMessage = "Manual Mode - Auto Setup: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString(); errorMessage = "Manual Mode - Auto Setup: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString();
return false; return false;
} }
private bool ValidateManualModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage) private bool ValidateManualModeObjects_Internal(GameObject sourceAvatar, GameObject sourceClothes, GameObject targetAvatar, GameObject targetClothes, out string errorMessage)
{ {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"), (targetClothes, "- Target Clothes Object")); this.ObjectNullCheck(stringBuilder, (sourceAvatar, "- Source Avatar Object"), (sourceClothes, "- Source Clothes Object"), (targetAvatar, "- Target Avatar Object"), (targetClothes, "- Target Clothes Object"));
if (sourceClothes != null) if (sourceClothes != null)
{ {
ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck")); this.ClothesChildCheck(stringBuilder, sourceAvatar, sourceClothes, LanguageManager.Get("UI.Validator.SourceClothesChildCheck"));
HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, sourceClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, sourceClothes, "Source " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (targetClothes != null) if (targetClothes != null)
{ {
ClothesChildCheck(stringBuilder, targetAvatar, targetClothes, LanguageManager.Get("UI.Validator.TargetClothesChildCheck")); this.ClothesChildCheck(stringBuilder, targetAvatar, targetClothes, LanguageManager.Get("UI.Validator.TargetClothesChildCheck"));
HasSMRInClothes(stringBuilder, targetClothes, "ClothesObject - There is No SkinnedMeshRenderer"); this.HasSMRInClothes(stringBuilder, targetClothes, "ClothesObject - There is No SkinnedMeshRenderer");
HasLocalArmature(stringBuilder, targetClothes, "Target " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck")); this.HasLocalArmature(stringBuilder, targetClothes, "Target " + LanguageManager.Get("UI.Validator.ClothesArmatureCheck"));
} }
if (sourceAvatar != null) if (sourceAvatar != null)
{ {
IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, sourceAvatar, LanguageManager.Get("UI.Validator.SourceAvatarAnimatorCheck"));
} }
if (targetAvatar != null) if (targetAvatar != null)
{ {
IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck")); this.IsHumanoid(stringBuilder, targetAvatar, LanguageManager.Get("UI.Validator.TargetAvatarAnimatorCheck"));
} }
if (sourceClothes != null && targetClothes != null) if (sourceClothes != null && targetClothes != null)
{ {
AppendSmrAndVertexCheck(stringBuilder, sourceClothes, targetClothes); this.AppendSmrAndVertexCheck(stringBuilder, sourceClothes, targetClothes);
} }
if (stringBuilder.Length == 0) if (stringBuilder.Length == 0)
{ {
errorMessage = null; errorMessage = null;
return true; return true;
} }
errorMessage = "Manual Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString(); errorMessage = "Manual Mode: " + LanguageManager.Get("UI.Validator.Can'tFitting") + stringBuilder.ToString();
return false; return false;
} }
private void ObjectNullCheck(StringBuilder sb, params (GameObject obj, string label)[] refs) private void ObjectNullCheck(StringBuilder sb, params (GameObject obj, string label)[] refs)
{ {
bool flag = false; bool flag = false;
for (int i = 0; i < refs.Length; i++) for (int i = 0; i < refs.Length; i++)
{ {
if (refs[i].obj == null) if (refs[i].obj == null)
{ {
flag = true; flag = true;
break; break;
} }
} }
if (!flag) if (!flag)
{ {
return; return;
} }
sb.AppendLine(LanguageManager.Get("UI.Validator.ReferenceCheck")); sb.AppendLine(LanguageManager.Get("UI.Validator.ReferenceCheck"));
for (int j = 0; j < refs.Length; j++) for (int j = 0; j < refs.Length; j++)
{ {
if (refs[j].obj == null) if (refs[j].obj == null)
{ {
sb.AppendLine(refs[j].label); sb.AppendLine(refs[j].label);
} }
} }
} }
private void ClothesChildCheck(StringBuilder sb, GameObject parentObject, GameObject childObject, string messageOnInvalid) private void ClothesChildCheck(StringBuilder sb, GameObject parentObject, GameObject childObject, string messageOnInvalid)
{ {
if (!(childObject == null) && (parentObject == null || !childObject.transform.IsChildOf(parentObject.transform))) if (!(childObject == null) && (parentObject == null || !childObject.transform.IsChildOf(parentObject.transform)))
{ {
if (sb.Length > 0) if (sb.Length > 0)
{ {
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendLine(messageOnInvalid); sb.AppendLine(messageOnInvalid);
} }
} }
private void HasSMRInClothes(StringBuilder sb, GameObject clothesRoot, string messageOnInvalid) private void HasSMRInClothes(StringBuilder sb, GameObject clothesRoot, string messageOnInvalid)
{ {
if (clothesRoot == null) if (clothesRoot == null)
{ {
return; return;
} }
SkinnedMeshRenderer[] componentsInChildren = clothesRoot.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true); SkinnedMeshRenderer[] componentsInChildren = clothesRoot.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true);
if (componentsInChildren == null || componentsInChildren.Length == 0) if (componentsInChildren == null || componentsInChildren.Length == 0)
{ {
if (sb.Length > 0) if (sb.Length > 0)
{ {
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendLine(messageOnInvalid); sb.AppendLine(messageOnInvalid);
} }
} }
private void HasLocalArmature(StringBuilder sb, GameObject clothesRoot, string messageOnInvalid) private void HasLocalArmature(StringBuilder sb, GameObject clothesRoot, string messageOnInvalid)
{ {
if (clothesRoot == null) if (clothesRoot == null)
{ {
return; return;
} }
SkinnedMeshRenderer[] componentsInChildren = clothesRoot.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true); SkinnedMeshRenderer[] componentsInChildren = clothesRoot.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true);
if (componentsInChildren == null || componentsInChildren.Length == 0) if (componentsInChildren == null || componentsInChildren.Length == 0)
{ {
return; return;
} }
Transform transform = clothesRoot.transform; Transform transform = clothesRoot.transform;
bool flag = true; bool flag = true;
SkinnedMeshRenderer[] array = componentsInChildren; SkinnedMeshRenderer[] array = componentsInChildren;
for (int i = 0; i < array.Length; i++) for (int i = 0; i < array.Length; i++)
{ {
Transform[] bones = array[i].bones; Transform[] bones = array[i].bones;
if (bones == null || bones.Length == 0) if (bones == null || bones.Length == 0)
{ {
continue; continue;
} }
Transform[] array2 = bones; Transform[] array2 = bones;
foreach (Transform transform2 in array2) foreach (Transform transform2 in array2)
{ {
if (!(transform2 == null) && !transform2.transform.IsChildOf(transform)) if (!(transform2 == null) && !transform2.transform.IsChildOf(transform))
{ {
flag = false; flag = false;
} }
} }
} }
if (!flag) if (!flag)
{ {
if (sb.Length > 0) if (sb.Length > 0)
{ {
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendLine(messageOnInvalid); sb.AppendLine(messageOnInvalid);
} }
} }
private bool IsHumanoid(StringBuilder sb, GameObject avatarObject, string messageOnInvalid) private bool IsHumanoid(StringBuilder sb, GameObject avatarObject, string messageOnInvalid)
{ {
if (avatarObject == null) if (avatarObject == null)
{ {
return false; return false;
} }
Animator component = avatarObject.GetComponent<Animator>(); Animator component = avatarObject.GetComponent<Animator>();
if (component == null) if (component == null)
{ {
return false; return false;
} }
if (component.avatar == null) if (component.avatar == null)
{ {
return false; return false;
} }
if (!component.avatar.isHuman) if (!component.avatar.isHuman)
{ {
return false; return false;
} }
return true; return true;
} }
private void AppendSmrAndVertexCheck(StringBuilder sb, GameObject sourceClothes, GameObject targetClothes) private void AppendSmrAndVertexCheck(StringBuilder sb, GameObject sourceClothes, GameObject targetClothes)
{ {
if (sourceClothes == null || targetClothes == null) if (sourceClothes == null || targetClothes == null)
{ {
return; return;
} }
SkinnedMeshRenderer[] componentsInChildren = sourceClothes.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true); SkinnedMeshRenderer[] componentsInChildren = sourceClothes.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true);
SkinnedMeshRenderer[] componentsInChildren2 = targetClothes.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true); SkinnedMeshRenderer[] componentsInChildren2 = targetClothes.GetComponentsInChildren<SkinnedMeshRenderer>(includeInactive: true);
int num = ((componentsInChildren != null) ? componentsInChildren.Length : 0); int num = ((componentsInChildren != null) ? componentsInChildren.Length : 0);
int num2 = ((componentsInChildren2 != null) ? componentsInChildren2.Length : 0); int num2 = ((componentsInChildren2 != null) ? componentsInChildren2.Length : 0);
if (num != num2) if (num != num2)
{ {
if (sb.Length > 0) if (sb.Length > 0)
{ {
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendLine(LanguageManager.Get("UI.Validator.CheckRendererCountCheck")); sb.AppendLine(LanguageManager.Get("UI.Validator.CheckRendererCountCheck"));
sb.AppendLine($"- Source Clothes SMR : {num}"); sb.AppendLine($"- Source Clothes SMR : {num}");
sb.AppendLine($"- Target Clothes SMR : {num2}"); sb.AppendLine($"- Target Clothes SMR : {num2}");
return; return;
} }
for (int i = 0; i < num; i++) for (int i = 0; i < num; i++)
{ {
SkinnedMeshRenderer skinnedMeshRenderer = componentsInChildren[i]; SkinnedMeshRenderer skinnedMeshRenderer = componentsInChildren[i];
SkinnedMeshRenderer skinnedMeshRenderer2 = componentsInChildren2[i]; SkinnedMeshRenderer skinnedMeshRenderer2 = componentsInChildren2[i];
if (skinnedMeshRenderer == null || skinnedMeshRenderer2 == null) if (skinnedMeshRenderer == null || skinnedMeshRenderer2 == null)
{ {
continue; continue;
} }
Mesh sharedMesh = skinnedMeshRenderer.sharedMesh; Mesh sharedMesh = skinnedMeshRenderer.sharedMesh;
Mesh sharedMesh2 = skinnedMeshRenderer2.sharedMesh; Mesh sharedMesh2 = skinnedMeshRenderer2.sharedMesh;
if (!(sharedMesh == null) && !(sharedMesh2 == null) && sharedMesh.vertexCount != sharedMesh2.vertexCount) if (!(sharedMesh == null) && !(sharedMesh2 == null) && sharedMesh.vertexCount != sharedMesh2.vertexCount)
{ {
if (sb.Length > 0) if (sb.Length > 0)
{ {
sb.AppendLine(); sb.AppendLine();
} }
sb.AppendLine(LanguageManager.Get("UI.Validator.VertexCountCheck")); sb.AppendLine(LanguageManager.Get("UI.Validator.VertexCountCheck"));
sb.AppendLine($"- Source: {skinnedMeshRenderer.name} (vertices: {sharedMesh.vertexCount})"); sb.AppendLine($"- Source: {skinnedMeshRenderer.name} (vertices: {sharedMesh.vertexCount})");
sb.AppendLine($"- Target: {skinnedMeshRenderer2.name} (vertices: {sharedMesh2.vertexCount})"); sb.AppendLine($"- Target: {skinnedMeshRenderer2.name} (vertices: {sharedMesh2.vertexCount})");
break; break;
} }
} }
} }
} }

View File

@@ -1,16 +1,16 @@
// Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts, // Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
// for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. // for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
// EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpherEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// Eden.AutoMorpher.ResultInfo // Eden.AutoMorpher.ResultInfo
public class ResultInfo public class ResultInfo
{ {
public bool isComplicated; public bool isComplicated;
public string processTyep = ""; public string processTyep = "";
public string processEndState = ""; public string processEndState = "";
public string processTime = ""; public string processTime = "";
public string errorMessage = ""; public string errorMessage = "";
} }