mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-30 18:22:52 +08:00
fix: change attachment mode causes non-undoable transform movement (#710)
Closes: #655
This commit is contained in:
parent
97fe8075a6
commit
6c4c0afb06
@ -1,9 +1,13 @@
|
||||
using System;
|
||||
#region
|
||||
|
||||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static nadena.dev.modular_avatar.core.editor.Localization;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
internal class TempObjRef : ScriptableObject
|
||||
@ -104,7 +108,18 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
serializedObject.UpdateIfRequiredOrScript();
|
||||
var p_attachmentMode = serializedObject.FindProperty(nameof(ModularAvatarBoneProxy.attachmentMode));
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(p_attachmentMode, G("boneproxy.attachment"));
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
foreach (var target in targets)
|
||||
{
|
||||
var t = (ModularAvatarBoneProxy)target;
|
||||
Undo.RecordObject(t.transform, "");
|
||||
t.Update();
|
||||
}
|
||||
}
|
||||
|
||||
foldout = EditorGUILayout.Foldout(foldout, G("boneproxy.foldout.advanced"));
|
||||
if (foldout)
|
||||
@ -122,7 +137,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
Localization.ShowLanguageUI();
|
||||
ShowLanguageUI();
|
||||
}
|
||||
|
||||
private void CheckAttachmentMode(ModularAvatarBoneProxy boneProxy)
|
||||
|
Loading…
Reference in New Issue
Block a user