/// <inheritdoc/> public NotificationItem Validate(VRChatAvatar avatar) { if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android) { return(null); } if (AvatarHasErrorForQuest(avatar)) { return(new NotificationItem(() => { if (avatar.AvatarDescriptor == null) { return true; } var i18n = VRCQuestToolsSettings.I18nResource; GUILayout.Label(i18n.IncompatibleForQuest, EditorStyles.wordWrappedLabel); GUILayout.Label($"- {avatar.GameObject.name}", EditorStyles.wordWrappedLabel); if (GUILayout.Button(i18n.DeactivateAvatar)) { avatar.GameObject.SetActive(false); return true; } return false; })); } return(null); }
private bool AvatarHasErrorForQuest(VRChatAvatar avatar) { if (!avatar.GameObject.activeInHierarchy) { return(false); } foreach (var m in avatar.GetRendererMaterials()) { if (!VRCSDKUtility.IsMaterialAllowedForQuestAvatar(m)) { return(true); } } if (new ComponentRemover().GetUnsupportedComponentsInChildren(avatar.GameObject, true).Length > 0) { return(true); } return(false); }
/// <inheritdoc/> public NotificationItem Validate(VRChatAvatar avatar) { if (!avatar.GameObject.activeInHierarchy) { return(null); } var hasDynamicBone = AssetUtility.IsDynamicBoneImported(); if (VRCSDKUtility.CountMissingComponentsInChildren(avatar.GameObject, true) > 0) { return(new NotificationItem(() => { if (avatar.AvatarDescriptor == null) { return true; } var i18n = VRCQuestToolsSettings.I18nResource; if (hasDynamicBone) { GUILayout.Label(i18n.MissingScripts, EditorStyles.wordWrappedLabel); } else { GUILayout.Label(i18n.MissingDynamicBone, EditorStyles.wordWrappedLabel); } GUILayout.Label($"- {avatar.GameObject.name}", EditorStyles.wordWrappedLabel); if (GUILayout.Button(i18n.RemoveMissing)) { Selection.activeGameObject = avatar.GameObject; EditorApplication.ExecuteMenuItem(VRCQuestToolsMenus.MenuPaths.RemoveMissingComponents); return false; } return false; })); } return(null); }