2023-11-10 15:37:56 +09:00
|
|
|
|
#if MA_VRCSDK3_AVATARS
|
|
|
|
|
|
|
|
|
|
using UnityEditor;
|
2022-11-10 20:39:58 -08:00
|
|
|
|
using static nadena.dev.modular_avatar.core.editor.Localization;
|
2022-10-16 14:05:26 -07:00
|
|
|
|
|
2022-11-10 20:39:58 -08:00
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor
|
2022-10-16 14:05:26 -07:00
|
|
|
|
{
|
|
|
|
|
[CustomPropertyDrawer(typeof(MergeAnimatorPathMode))]
|
2022-11-23 19:20:31 -08:00
|
|
|
|
class PathModeDrawer : EnumDrawer<MergeAnimatorPathMode>
|
2022-10-16 14:05:26 -07:00
|
|
|
|
{
|
2022-11-23 19:20:31 -08:00
|
|
|
|
protected override string localizationPrefix => "path_mode";
|
2022-10-16 14:05:26 -07:00
|
|
|
|
}
|
|
|
|
|
|
2025-03-10 20:37:29 -07:00
|
|
|
|
[CustomPropertyDrawer(typeof(MergeAnimatorMode))]
|
|
|
|
|
internal class MergeModeDrawer : EnumDrawer<MergeAnimatorMode>
|
|
|
|
|
{
|
|
|
|
|
protected override string localizationPrefix => "merge_animator.merge_mode";
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-16 14:05:26 -07:00
|
|
|
|
[CustomEditor(typeof(ModularAvatarMergeAnimator))]
|
2022-11-10 20:30:10 -08:00
|
|
|
|
class MergeAnimationEditor : MAEditorBase
|
2022-10-16 14:05:26 -07:00
|
|
|
|
{
|
|
|
|
|
private SerializedProperty prop_animator,
|
|
|
|
|
prop_layerType,
|
|
|
|
|
prop_deleteAttachedAnimator,
|
|
|
|
|
prop_pathMode,
|
2023-12-22 17:17:40 +09:00
|
|
|
|
prop_matchAvatarWriteDefaults,
|
|
|
|
|
prop_relativePathRoot,
|
2025-03-10 20:37:29 -07:00
|
|
|
|
prop_layerPriority,
|
|
|
|
|
prop_mergeMode;
|
2022-10-16 14:05:26 -07:00
|
|
|
|
|
|
|
|
|
private void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
prop_animator = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.animator));
|
|
|
|
|
prop_layerType = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.layerType));
|
|
|
|
|
prop_deleteAttachedAnimator =
|
|
|
|
|
serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.deleteAttachedAnimator));
|
|
|
|
|
prop_pathMode = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.pathMode));
|
|
|
|
|
prop_matchAvatarWriteDefaults =
|
|
|
|
|
serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.matchAvatarWriteDefaults));
|
2023-12-22 17:17:40 +09:00
|
|
|
|
prop_relativePathRoot =
|
|
|
|
|
serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.relativePathRoot));
|
|
|
|
|
prop_layerPriority = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.layerPriority));
|
2025-03-10 20:37:29 -07:00
|
|
|
|
prop_mergeMode = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.mergeAnimatorMode));
|
2022-10-16 14:05:26 -07:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-10 20:30:10 -08:00
|
|
|
|
protected override void OnInnerInspectorGUI()
|
2022-10-16 14:05:26 -07:00
|
|
|
|
{
|
|
|
|
|
serializedObject.Update();
|
|
|
|
|
|
|
|
|
|
EditorGUILayout.PropertyField(prop_animator, G("merge_animator.animator"));
|
|
|
|
|
EditorGUILayout.PropertyField(prop_layerType, G("merge_animator.layer_type"));
|
|
|
|
|
EditorGUILayout.PropertyField(prop_deleteAttachedAnimator, G("merge_animator.delete_attached_animator"));
|
|
|
|
|
EditorGUILayout.PropertyField(prop_pathMode, G("merge_animator.path_mode"));
|
2023-12-22 17:17:40 +09:00
|
|
|
|
if (prop_pathMode.enumValueIndex == (int) MergeAnimatorPathMode.Relative)
|
|
|
|
|
EditorGUILayout.PropertyField(prop_relativePathRoot, G("merge_animator.relative_path_root"));
|
|
|
|
|
EditorGUILayout.PropertyField(prop_layerPriority, G("merge_animator.layer_priority"));
|
2025-03-10 20:37:29 -07:00
|
|
|
|
EditorGUILayout.PropertyField(prop_mergeMode, G("merge_animator.merge_mode"));
|
|
|
|
|
using (new EditorGUI.DisabledScope(prop_mergeMode.enumValueIndex == (int)MergeAnimatorMode.Replace))
|
|
|
|
|
{
|
|
|
|
|
EditorGUILayout.PropertyField(prop_matchAvatarWriteDefaults,
|
|
|
|
|
G("merge_animator.match_avatar_write_defaults"));
|
|
|
|
|
}
|
2022-10-16 14:05:26 -07:00
|
|
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
|
|
|
|
|
|
ShowLanguageUI();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-10 15:37:56 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|