2022-10-17 05:05:26 +08:00
|
|
|
|
using UnityEditor;
|
2022-11-11 12:39:58 +08:00
|
|
|
|
using static nadena.dev.modular_avatar.core.editor.Localization;
|
2022-10-17 05:05:26 +08:00
|
|
|
|
|
2022-11-11 12:39:58 +08:00
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor
|
2022-10-17 05:05:26 +08:00
|
|
|
|
{
|
|
|
|
|
[CustomPropertyDrawer(typeof(MergeAnimatorPathMode))]
|
2022-11-24 11:20:31 +08:00
|
|
|
|
class PathModeDrawer : EnumDrawer<MergeAnimatorPathMode>
|
2022-10-17 05:05:26 +08:00
|
|
|
|
{
|
2022-11-24 11:20:31 +08:00
|
|
|
|
protected override string localizationPrefix => "path_mode";
|
2022-10-17 05:05:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[CustomEditor(typeof(ModularAvatarMergeAnimator))]
|
2022-11-11 12:30:10 +08:00
|
|
|
|
class MergeAnimationEditor : MAEditorBase
|
2022-10-17 05:05:26 +08:00
|
|
|
|
{
|
|
|
|
|
private SerializedProperty prop_animator,
|
|
|
|
|
prop_layerType,
|
|
|
|
|
prop_deleteAttachedAnimator,
|
|
|
|
|
prop_pathMode,
|
|
|
|
|
prop_matchAvatarWriteDefaults;
|
|
|
|
|
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-11 12:30:10 +08:00
|
|
|
|
protected override void OnInnerInspectorGUI()
|
2022-10-17 05:05:26 +08: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"));
|
|
|
|
|
EditorGUILayout.PropertyField(prop_matchAvatarWriteDefaults,
|
|
|
|
|
G("merge_animator.match_avatar_write_defaults"));
|
|
|
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
|
|
|
|
|
|
ShowLanguageUI();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|