modular-avatar/Packages/nadena.dev.modular-avatar/Editor/Inspector/ProbeAnchorEditor.cs
AoiKamishiro 7bc29b2ea5
MAProbeAnchorの追加(ModularAvatarでAnchorOverrideを設定できるように) (#304)
Co-authored-by: AoiKamishiro <aoi.kamishiro@kamishiro.online>
2023-06-05 18:53:49 +09:00

39 lines
1.1 KiB
C#

using UnityEditor;
using static nadena.dev.modular_avatar.core.editor.Localization;
namespace nadena.dev.modular_avatar.core.editor
{
[CustomEditor(typeof(ModularAvatarProbeAnchor))]
[CanEditMultipleObjects]
internal class ProbeAnchorEditor : MAEditorBase
{
private SerializedProperty prop_probeTarget;
private void OnEnable()
{
prop_probeTarget = serializedObject.FindProperty(nameof(ModularAvatarProbeAnchor.probeTarget));
}
private void ShowParametersUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(prop_probeTarget, G("probeanchor.target"));
serializedObject.ApplyModifiedProperties();
}
protected override void OnInnerInspectorGUI()
{
EditorGUILayout.HelpBox(S("probe_anchor.help"), MessageType.Info);
EditorGUI.BeginChangeCheck();
ShowParametersUI();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
Localization.ShowLanguageUI();
}
}
}