modular-avatar/Packages/nadena.dev.modular-avatar/Editor/Inspector/FirstPersonVisibleEditor.cs
anatawa12 6591f35a78
fix: missing references when VPM resolver is not present
* chore: configure overrideReferences false and referenced dlls

* chore: clear unused using

* chore: remove unused meta file

* fix: missing reference
2023-08-22 18:44:02 +09:00

52 lines
1.6 KiB
C#

using UnityEditor;
namespace nadena.dev.modular_avatar.core.editor
{
[CustomEditor(typeof(ModularAvatarVisibleHeadAccessory))]
internal class FirstPersonVisibleEditor : MAEditorBase
{
private VisibleHeadAccessoryProcessor _processor;
private void OnEnable()
{
var target = (ModularAvatarVisibleHeadAccessory) this.target;
var avatar = RuntimeUtil.FindAvatarInParents(target.transform);
if (avatar != null) _processor = new VisibleHeadAccessoryProcessor(avatar);
}
protected override void OnInnerInspectorGUI()
{
var target = (ModularAvatarVisibleHeadAccessory) this.target;
#if UNITY_ANDROID
EditorGUILayout.HelpBox(Localization.S("fpvisible.quest"), MessageType.Warning);
#else
if (_processor != null)
{
var status = _processor.Validate(target);
switch (status)
{
case VisibleHeadAccessoryProcessor.ReadyStatus.Ready:
case VisibleHeadAccessoryProcessor.ReadyStatus.ParentMarked:
EditorGUILayout.HelpBox(Localization.S("fpvisible.normal"), MessageType.Info);
break;
default:
{
var label = "fpvisible." + status;
EditorGUILayout.HelpBox(Localization.S(label), MessageType.Error);
break;
}
}
}
#endif
Localization.ShowLanguageUI();
}
}
}