VisualScriptingUtility

Class

A utility class that assists with communicating between Visual Scripting and C#.

Methods

AddCustomEventListener(GameObject, Action<string, object[]>)

Add a listener for a custom visual scripting event.

RemoveCustomEventListener(GameObject, Delegate)

Remove a listener for a custom visual scripting event.

ToDictionary<TKey>(AotDictionary)

Convert an AOTDiction to a List of a given type.

ToList<T>(AotList)

Convert an AotList to a List of a given type.

TriggerCustomEvent(GameObject, string, params object[])

Trigger a custom visual scripting event.

Examples

public GameObject objectWithScriptMachine;

public void RaiseVisualScriptingEvent()
{
VisualScriptingUtility.TriggerCustomEvent(objectWithScriptMachine, "MyEvent");
}

public void RaiseVisualScriptingEventWithParameters(int param1, int param2)
{
VisualScriptingUtility.TriggerCustomEvent(objectWithScriptMachine, "MyEventWithParams", param1, param2);
}
public GameObject objectWithScriptMachine;

public void RaiseVisualScriptingEvent()
{
VisualScriptingUtility.TriggerCustomEvent(objectWithScriptMachine, "MyEvent");
}

public void RaiseVisualScriptingEventWithParameters(int param1, int param2)
{
VisualScriptingUtility.TriggerCustomEvent(objectWithScriptMachine, "MyEventWithParams", param1, param2);
}