2023-11-10 15:37:56 +09:00
|
|
|
|
#if MA_VRCSDK3_AVATARS
|
|
|
|
|
|
2024-11-16 19:00:35 -08:00
|
|
|
|
using System;
|
|
|
|
|
using JetBrains.Annotations;
|
2023-11-10 15:37:56 +09:00
|
|
|
|
using UnityEngine;
|
2022-11-06 19:33:48 -08:00
|
|
|
|
using VRC.SDK3.Avatars.ScriptableObjects;
|
2022-10-04 17:34:04 -07:00
|
|
|
|
|
2022-11-10 20:39:58 -08:00
|
|
|
|
namespace nadena.dev.modular_avatar.core
|
2022-10-04 17:34:04 -07:00
|
|
|
|
{
|
2022-11-09 17:49:00 -08:00
|
|
|
|
[AddComponentMenu("Modular Avatar/MA Menu Installer")]
|
2023-10-11 20:40:26 +09:00
|
|
|
|
[HelpURL("https://modular-avatar.nadena.dev/docs/reference/menu-installer?lang=auto")]
|
2022-10-04 17:34:04 -07:00
|
|
|
|
public class ModularAvatarMenuInstaller : AvatarTagComponent
|
2023-02-25 16:45:24 +09:00
|
|
|
|
{
|
|
|
|
|
public VRCExpressionsMenu menuToAppend;
|
2022-10-04 17:34:04 -07:00
|
|
|
|
public VRCExpressionsMenu installTargetMenu;
|
2022-11-06 19:33:48 -08:00
|
|
|
|
|
2024-11-16 19:00:35 -08:00
|
|
|
|
internal static Action<ModularAvatarMenuInstaller> _openSelectMenu = _ => { };
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Opens the "Select Menu" window, as if the user had clicked this button in the inspector.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[PublicAPI]
|
|
|
|
|
public void OpenSelectMenu()
|
|
|
|
|
{
|
|
|
|
|
_openSelectMenu(this);
|
|
|
|
|
}
|
2022-11-06 19:33:48 -08:00
|
|
|
|
|
|
|
|
|
// ReSharper disable once Unity.RedundantEventFunction
|
|
|
|
|
void Start()
|
2023-02-25 16:45:24 +09:00
|
|
|
|
{
|
|
|
|
|
// Ensure that unity generates an enable checkbox
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnValidate()
|
|
|
|
|
{
|
|
|
|
|
base.OnValidate();
|
|
|
|
|
|
|
|
|
|
RuntimeUtil.InvalidateMenu();
|
|
|
|
|
}
|
2023-08-05 15:47:03 +09:00
|
|
|
|
|
2023-09-24 14:44:07 +09:00
|
|
|
|
public override void ResolveReferences()
|
2023-08-05 15:47:03 +09:00
|
|
|
|
{
|
|
|
|
|
// no-op
|
|
|
|
|
}
|
2022-10-04 17:34:04 -07:00
|
|
|
|
}
|
2023-11-10 15:37:56 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|