modular-avatar/Runtime/ModularAvatarObjectToggle.cs
bd_ 8e7526e711
Connect reactive components to MenuItems (#944)
* refactor: generalize support for arbitrary parameters as conditions

* feat: automatically assign Menu Item parameters

* feat: ReactiveComponents respond to MenuItems

* feat: AvatarObjectReference tracks both paths and direct object references

* feat: set isSaved/isSynced/default values from MenuItem

* feat: Object Toggle preview supports menu items and manipulating parent objects

* feat: reactive previews respond to menu item default value states

* chore: update NDMF dependency
2024-08-04 19:31:43 -07:00

26 lines
679 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace nadena.dev.modular_avatar.core
{
[Serializable]
public struct ToggledObject
{
public AvatarObjectReference Object;
public bool Active;
}
[AddComponentMenu("Modular Avatar/MA Object Toggle")]
[HelpURL("https://modular-avatar.nadena.dev/docs/reference/object-toggle?lang=auto")]
public class ModularAvatarObjectToggle : ReactiveComponent
{
[SerializeField] private List<ToggledObject> m_objects = new();
public List<ToggledObject> Objects
{
get => m_objects;
set => m_objects = value;
}
}
}