I'm trying to work on a plugin for breathing. I have a slider bar so breathing can go faster or slower. I'm trying to create a "Configure On Breath" button that will show a "Discreet Actions" menu where you can add a bunch of triggers, but its not working. Here's a snippet of the code. Right now I just have a single .CS file. I don't have much experience with these and I'm just trying to throw something together. Edit: The purpose of the trigger is to add a trigger for Audiomate where I have a random breath sound collection.
I have this, but the Configure button is not working.
I want one of these menus to pop up so I can configure triggers.
// Define and register the action
var breathTrigger = new JSONStorableAction("OnBreath", () => {
OnBreath.Invoke();
});
RegisterAction(breathTrigger);
// Manual test button
CreateButton("Test Breath Trigger").button.onClick.AddListener(() => breathTrigger.actionCallback());
// Configure button that opens the discrete actions editor
CreateButton("Configure Breath Trigger").button.onClick.AddListener(() => {
if (breathTrigger.actionCallback != null)
{
breathTrigger.actionCallback(); // VaM will open the discrete actions popup for this action
}
});
}
I have this, but the Configure button is not working.
I want one of these menus to pop up so I can configure triggers.
// Define and register the action
var breathTrigger = new JSONStorableAction("OnBreath", () => {
OnBreath.Invoke();
});
RegisterAction(breathTrigger);
// Manual test button
CreateButton("Test Breath Trigger").button.onClick.AddListener(() => breathTrigger.actionCallback());
// Configure button that opens the discrete actions editor
CreateButton("Configure Breath Trigger").button.onClick.AddListener(() => {
if (breathTrigger.actionCallback != null)
{
breathTrigger.actionCallback(); // VaM will open the discrete actions popup for this action
}
});
}