2023-11-10 14:37:56 +08:00
|
|
|
|
#if MA_VRCSDK3_AVATARS
|
|
|
|
|
|
|
|
|
|
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,
|
2023-12-22 16:17:40 +08:00
|
|
|
|
prop_matchAvatarWriteDefaults,
|
|
|
|
|
prop_relativePathRoot,
|
|
|
|
|
prop_layerPriority;
|
2022-10-17 05:05:26 +08: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 16:17:40 +08:00
|
|
|
|
prop_relativePathRoot =
|
|
|
|
|
serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.relativePathRoot));
|
|
|
|
|
prop_layerPriority = serializedObject.FindProperty(nameof(ModularAvatarMergeAnimator.layerPriority));
|
2022-10-17 05:05:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
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"));
|
2023-12-22 16:17:40 +08: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"));
|
2022-10-17 05:05:26 +08:00
|
|
|
|
EditorGUILayout.PropertyField(prop_matchAvatarWriteDefaults,
|
|
|
|
|
G("merge_animator.match_avatar_write_defaults"));
|
|
|
|
|
|
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
|
|
|
|
|
|
|
|
ShowLanguageUI();
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-10 14:37:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|