mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 12:15:05 +08:00
3b067e4664
* Disable compilation for use in Unity 6 (6000.0.20f1): - Do not compile some classes and code paths in non-VRChat projects. - This has been tested in Unity 6 (6000.0.20f1). * Fix hide internal components in Unity 6: - [AddComponentMenu("")] does not work in Unity 6. - Replace it with [AddComponentMenu("/")] - This alternative is confirmed to also work in Unity 2022. --------- Co-authored-by: Haï~ <hai-vr@users.noreply.github.com> Co-authored-by: bd_ <bd_@nadena.dev>
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
#if MA_VRCSDK3_AVATARS
|
|
using UnityEditor;
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor
|
|
{
|
|
[CustomEditor(typeof(ModularAvatarVisibleHeadAccessory))]
|
|
internal class FirstPersonVisibleEditor : MAEditorBase
|
|
{
|
|
private VisibleHeadAccessoryValidation _validation;
|
|
|
|
private void OnEnable()
|
|
{
|
|
var target = (ModularAvatarVisibleHeadAccessory) this.target;
|
|
var avatar = RuntimeUtil.FindAvatarTransformInParents(target.transform);
|
|
|
|
if (avatar != null) _validation = new VisibleHeadAccessoryValidation(avatar.gameObject);
|
|
}
|
|
|
|
protected override void OnInnerInspectorGUI()
|
|
{
|
|
var target = (ModularAvatarVisibleHeadAccessory) this.target;
|
|
|
|
if (_validation != null)
|
|
{
|
|
var status = _validation.Validate(target);
|
|
|
|
switch (status)
|
|
{
|
|
case VisibleHeadAccessoryValidation.ReadyStatus.Ready:
|
|
case VisibleHeadAccessoryValidation.ReadyStatus.ParentMarked:
|
|
EditorGUILayout.HelpBox(Localization.S("fpvisible.normal"), MessageType.Info);
|
|
break;
|
|
case VisibleHeadAccessoryValidation.ReadyStatus.NotUnderHead:
|
|
EditorGUILayout.HelpBox(Localization.S("fpvisible.NotUnderHead"), MessageType.Warning);
|
|
break;
|
|
default:
|
|
{
|
|
var label = "fpvisible." + status;
|
|
EditorGUILayout.HelpBox(Localization.S(label), MessageType.Error);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
Localization.ShowLanguageUI();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |