포매팅

This commit is contained in:
2026-02-01 19:23:23 +09:00
parent ff3a3c522e
commit 15efd5b720

View File

@@ -1,11 +1,10 @@
// 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.
// EdenAutoMorpher_ProfileSaver_Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // EdenAutoMorpher_ProfileSaver_Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// EdenAutoMorpher_ProfileSaverEditor // EdenAutoMorpher_ProfileSaverEditor
using Eden.AutoMorpher;
using System; using System;
using System.IO; using System.IO;
using Eden.AutoMorpher;
using Eden.AutoMorpher.profile;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
@@ -22,25 +21,25 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
private void OnEnable() private void OnEnable()
{ {
saver = (EdenAutoMorpher_ProfileSaver)base.target; this.saver = (EdenAutoMorpher_ProfileSaver)base.target;
profileUtils = new ProfileUtils(); this.profileUtils = new ProfileUtils();
} }
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
base.serializedObject.Update(); base.serializedObject.Update();
DrawProfileVersion(); this.DrawProfileVersion();
EditorGUILayout.Space(8f); EditorGUILayout.Space(8f);
DrawGuideMessage(); this.DrawGuideMessage();
EditorGUILayout.Space(10f); EditorGUILayout.Space(10f);
DrawRequiredInputFields(); this.DrawRequiredInputFields();
EditorGUILayout.Space(10f); EditorGUILayout.Space(10f);
DrawSavePath(); this.DrawSavePath();
EditorGUILayout.Space(8f); EditorGUILayout.Space(8f);
ValidateInputs(); this.ValidateInputs();
DrawErrorMessage(); this.DrawErrorMessage();
EditorGUILayout.Space(12f); EditorGUILayout.Space(12f);
DrawSaveButton(); this.DrawSaveButton();
base.serializedObject.ApplyModifiedProperties(); base.serializedObject.ApplyModifiedProperties();
} }
@@ -56,7 +55,7 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
//IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references)
int profileVersion = profileUtils.GetProfileVersion(); int profileVersion = this.profileUtils.GetProfileVersion();
EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("EDEN Auto Morpher - Profile Saver", EditorStyles.boldLabel); EditorGUILayout.LabelField("EDEN Auto Morpher - Profile Saver", EditorStyles.boldLabel);
GUILayout.FlexibleSpace(); GUILayout.FlexibleSpace();
@@ -100,7 +99,7 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
private void DrawSavePath() private void DrawSavePath()
{ {
EditorGUILayout.LabelField("Save Path", EditorStyles.boldLabel); EditorGUILayout.LabelField("Save Path", EditorStyles.boldLabel);
string text = Path.Combine(profileUtils.GetProfileBasePath(), saver.profileName ?? string.Empty); string text = Path.Combine(this.profileUtils.GetProfileBasePath(), this.saver.profileName ?? string.Empty);
using (new EditorGUI.DisabledScope(disabled: true)) using (new EditorGUI.DisabledScope(disabled: true))
{ {
EditorGUILayout.TextField(text); EditorGUILayout.TextField(text);
@@ -109,51 +108,51 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
private void ValidateInputs() private void ValidateInputs()
{ {
errorMessage = "\n"; this.errorMessage = "\n";
hasError = false; this.hasError = false;
if (string.IsNullOrEmpty(saver.profileName)) if (string.IsNullOrEmpty(this.saver.profileName))
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.ProfileNameEmpty") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.ProfileNameEmpty") + "\n";
hasError = true; this.hasError = true;
} }
if (saver.sourceAvatar == null) if (this.saver.sourceAvatar == null)
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarNull") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarNull") + "\n";
hasError = true; this.hasError = true;
} }
else if (saver.sourceAvatar.GetComponent<Animator>() == null) else if (this.saver.sourceAvatar.GetComponent<Animator>() == null)
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarAnimatorMissing") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarAnimatorMissing") + "\n";
hasError = true; this.hasError = true;
} }
if (saver.sourceBodyMeshes == null || saver.sourceBodyMeshes.Count == 0) if (this.saver.sourceBodyMeshes == null || this.saver.sourceBodyMeshes.Count == 0)
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesEmpty") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesEmpty") + "\n";
hasError = true; this.hasError = true;
} }
else else
{ {
if (IsBodyMeshesContainNull()) if (this.IsBodyMeshesContainNull())
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesContainNull") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesContainNull") + "\n";
hasError = true; this.hasError = true;
} }
if (saver.sourceAvatar != null && IsBodyMeshNotChildOfAvatar()) if (this.saver.sourceAvatar != null && this.IsBodyMeshNotChildOfAvatar())
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BodyMeshNotChildOfAvatar") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BodyMeshNotChildOfAvatar") + "\n";
hasError = true; this.hasError = true;
} }
} }
if (!saver.IsExistBaseData()) if (!this.saver.IsExistBaseData())
{ {
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BaseDataMissing") + "\n"; this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BaseDataMissing") + "\n";
hasError = true; this.hasError = true;
} }
} }
private bool IsBodyMeshesContainNull() private bool IsBodyMeshesContainNull()
{ {
foreach (SkinnedMeshRenderer sourceBodyMesh in saver.sourceBodyMeshes) foreach (SkinnedMeshRenderer sourceBodyMesh in this.saver.sourceBodyMeshes)
{ {
if (sourceBodyMesh == null) if (sourceBodyMesh == null)
{ {
@@ -165,9 +164,9 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
private bool IsBodyMeshNotChildOfAvatar() private bool IsBodyMeshNotChildOfAvatar()
{ {
foreach (SkinnedMeshRenderer sourceBodyMesh in saver.sourceBodyMeshes) foreach (SkinnedMeshRenderer sourceBodyMesh in this.saver.sourceBodyMeshes)
{ {
if (sourceBodyMesh != null && !sourceBodyMesh.transform.IsChildOf(saver.sourceAvatar.transform)) if (sourceBodyMesh != null && !sourceBodyMesh.transform.IsChildOf(this.saver.sourceAvatar.transform))
{ {
return true; return true;
} }
@@ -177,19 +176,19 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
private void DrawErrorMessage() private void DrawErrorMessage()
{ {
if (hasError) if (this.hasError)
{ {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error); EditorGUILayout.HelpBox(this.errorMessage, MessageType.Error);
} }
} }
private void DrawSaveButton() private void DrawSaveButton()
{ {
using (new EditorGUI.DisabledScope(hasError)) using (new EditorGUI.DisabledScope(this.hasError))
{ {
if (GUILayout.Button("Save Profile", GUILayout.Height(34f))) if (GUILayout.Button("Save Profile", GUILayout.Height(34f)))
{ {
saver.SaveProfile(); this.saver.SaveProfile();
} }
} }
} }