Hi,
I am working with ORK 3/ Makinom 2 beta version. I created a custom schematic node and want to allow for arguments (that will be used inside Execute function). How do I feed the arguments from the Editor ? "public", "[SerializeField]private" don't seem to work.
// Code Snippet
[EditorHelp("Speak","Uses TTS voice to speak supplied text","Must provide voice type,voice line and Audio source")]
[NodeInfo("Text-to-Speech")]
public class SpeakNode : BaseSchematicNode
{
public string voice_name;
public string voice_lines;
public AudioSource voice_actor;
public override void Execute(Schematic schematic){
// To be used here
}
}
Thanks
public string voice_name = "";
You can also use the various value selection fields, e.g.:
public StringValue<SchematicObjectSelection> name = new StringValue<SchematicObjectSelection>();
However, AudioSource can't be used here - you can't store references to components of game objects in your scene (or prefabs), as the schematic doesn't have any connection to that.
Instead, you'd use an object selection (e.g. to use the Machine Object or an actor) and get the component from that:
public SchematicObjectSelection onObject = new SchematicObjectSelection();
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I am trying to setup an Event Handler inside the SchematicNode, which needs to get triggered for execution of the node to begin.
I am using an asset for TTS voice-over, which provides Speaker.Instance Singleton, with "OnSpeakComplete" event to confirm that the voice-line is over. The event will act as the trigger to move to next node (that handles next voice-line). This doesn't work and I don't know how exactly I must handle the event handler - speakComplete. Please help
Using += or -= on event handlers is only adding or removing functions to them, they don't cause anything else, e.g. starting your text to speech functionality.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!