포매팅
This commit is contained in:
@@ -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.
|
||||
// EdenAutoMorpher_ProfileSaver_Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
// EdenAutoMorpher_ProfileSaverEditor
|
||||
using Eden.AutoMorpher;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Eden.AutoMorpher;
|
||||
using Eden.AutoMorpher.profile;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -22,25 +21,25 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
saver = (EdenAutoMorpher_ProfileSaver)base.target;
|
||||
profileUtils = new ProfileUtils();
|
||||
this.saver = (EdenAutoMorpher_ProfileSaver)base.target;
|
||||
this.profileUtils = new ProfileUtils();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.serializedObject.Update();
|
||||
DrawProfileVersion();
|
||||
this.DrawProfileVersion();
|
||||
EditorGUILayout.Space(8f);
|
||||
DrawGuideMessage();
|
||||
this.DrawGuideMessage();
|
||||
EditorGUILayout.Space(10f);
|
||||
DrawRequiredInputFields();
|
||||
this.DrawRequiredInputFields();
|
||||
EditorGUILayout.Space(10f);
|
||||
DrawSavePath();
|
||||
this.DrawSavePath();
|
||||
EditorGUILayout.Space(8f);
|
||||
ValidateInputs();
|
||||
DrawErrorMessage();
|
||||
this.ValidateInputs();
|
||||
this.DrawErrorMessage();
|
||||
EditorGUILayout.Space(12f);
|
||||
DrawSaveButton();
|
||||
this.DrawSaveButton();
|
||||
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_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)
|
||||
int profileVersion = profileUtils.GetProfileVersion();
|
||||
int profileVersion = this.profileUtils.GetProfileVersion();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField("EDEN Auto Morpher - Profile Saver", EditorStyles.boldLabel);
|
||||
GUILayout.FlexibleSpace();
|
||||
@@ -100,7 +99,7 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
|
||||
private void DrawSavePath()
|
||||
{
|
||||
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))
|
||||
{
|
||||
EditorGUILayout.TextField(text);
|
||||
@@ -109,51 +108,51 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
|
||||
|
||||
private void ValidateInputs()
|
||||
{
|
||||
errorMessage = "\n";
|
||||
hasError = false;
|
||||
if (string.IsNullOrEmpty(saver.profileName))
|
||||
this.errorMessage = "\n";
|
||||
this.hasError = false;
|
||||
if (string.IsNullOrEmpty(this.saver.profileName))
|
||||
{
|
||||
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.ProfileNameEmpty") + "\n";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.ProfileNameEmpty") + "\n";
|
||||
this.hasError = true;
|
||||
}
|
||||
if (saver.sourceAvatar == null)
|
||||
if (this.saver.sourceAvatar == null)
|
||||
{
|
||||
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarNull") + "\n";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarNull") + "\n";
|
||||
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";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceAvatarAnimatorMissing") + "\n";
|
||||
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";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesEmpty") + "\n";
|
||||
this.hasError = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsBodyMeshesContainNull())
|
||||
if (this.IsBodyMeshesContainNull())
|
||||
{
|
||||
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesContainNull") + "\n";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.SourceBodyMeshesContainNull") + "\n";
|
||||
this.hasError = true;
|
||||
}
|
||||
if (saver.sourceAvatar != null && IsBodyMeshNotChildOfAvatar())
|
||||
if (this.saver.sourceAvatar != null && this.IsBodyMeshNotChildOfAvatar())
|
||||
{
|
||||
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BodyMeshNotChildOfAvatar") + "\n";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BodyMeshNotChildOfAvatar") + "\n";
|
||||
this.hasError = true;
|
||||
}
|
||||
}
|
||||
if (!saver.IsExistBaseData())
|
||||
if (!this.saver.IsExistBaseData())
|
||||
{
|
||||
errorMessage = errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BaseDataMissing") + "\n";
|
||||
hasError = true;
|
||||
this.errorMessage = this.errorMessage + LanguageManager.Get("UI.ProfileSaver.Error.BaseDataMissing") + "\n";
|
||||
this.hasError = true;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsBodyMeshesContainNull()
|
||||
{
|
||||
foreach (SkinnedMeshRenderer sourceBodyMesh in saver.sourceBodyMeshes)
|
||||
foreach (SkinnedMeshRenderer sourceBodyMesh in this.saver.sourceBodyMeshes)
|
||||
{
|
||||
if (sourceBodyMesh == null)
|
||||
{
|
||||
@@ -165,9 +164,9 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -177,19 +176,19 @@ public class EdenAutoMorpher_ProfileSaverEditor : Editor
|
||||
|
||||
private void DrawErrorMessage()
|
||||
{
|
||||
if (hasError)
|
||||
if (this.hasError)
|
||||
{
|
||||
EditorGUILayout.HelpBox(errorMessage, MessageType.Error);
|
||||
EditorGUILayout.HelpBox(this.errorMessage, MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSaveButton()
|
||||
{
|
||||
using (new EditorGUI.DisabledScope(hasError))
|
||||
using (new EditorGUI.DisabledScope(this.hasError))
|
||||
{
|
||||
if (GUILayout.Button("Save Profile", GUILayout.Height(34f)))
|
||||
{
|
||||
saver.SaveProfile();
|
||||
this.saver.SaveProfile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user