2022-11-08 12:43:51 +08:00
|
|
|
|
using UnityEditor;
|
2023-10-09 14:55:27 +08:00
|
|
|
|
|
|
|
|
|
#if UNITY_2021_2_OR_NEWER
|
|
|
|
|
using UnityEditor.SceneManagement;
|
|
|
|
|
#else
|
2022-11-08 12:43:51 +08:00
|
|
|
|
using UnityEditor.Experimental.SceneManagement;
|
2023-10-09 14:55:27 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
2022-11-08 12:43:51 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-11-11 12:39:58 +08:00
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor
|
2022-11-08 12:43:51 +08:00
|
|
|
|
{
|
|
|
|
|
internal static class InspectorCommon
|
|
|
|
|
{
|
|
|
|
|
internal static void DisplayOutOfAvatarWarning(Object[] targets)
|
|
|
|
|
{
|
|
|
|
|
if (PrefabStageUtility.GetCurrentPrefabStage() != null) return;
|
|
|
|
|
if (targets.Length != 1) return;
|
|
|
|
|
|
|
|
|
|
var target = targets[0] as Component;
|
|
|
|
|
if (target == null) return;
|
|
|
|
|
|
2023-10-15 17:44:53 +08:00
|
|
|
|
if (RuntimeUtil.FindAvatarTransformInParents(target.transform) == null)
|
2022-11-08 12:43:51 +08:00
|
|
|
|
{
|
|
|
|
|
EditorGUILayout.HelpBox(Localization.S("hint.not_in_avatar"), MessageType.Warning);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-10 03:40:16 +08:00
|
|
|
|
|
|
|
|
|
public static void DisplayVRCSDKVersionWarning()
|
|
|
|
|
{
|
|
|
|
|
EditorGUILayout.HelpBox(Localization.S("hint.bad_vrcsdk"), MessageType.Error);
|
|
|
|
|
}
|
2022-11-08 12:43:51 +08:00
|
|
|
|
}
|
|
|
|
|
}
|