Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Event handles

Discussion in 'Visual Scripting' started by Tyndareus, Aug 25, 2020.

  1. Tyndareus


    Aug 31, 2018
    We have various artists on the team and suddenly the rise for bolt has appeared, some of our background stuff interfaces through some scriptable objects (which have a value changed event), the trigger for that is external (signalr message) but we tend to subscribe to said event in various scenarios.
    How would someone who isn't going to be coding manage the subscription? Having had a look myself it seems it only supports events that are defined in a graph but i might not be looking correctly.
  2. JasonJonesLASM


    Sep 5, 2012
    You may want to start looking into building a custom unit for your events. Custom Events do no have an awareness of subscribing new data or events. They can only be manually triggered in graph or code.

    If you have never touched the Units API, I have beginner tutorials here ->

    And when you get to events, you'd want to Inherit ManualEvent. Overriding StartListening and StopListening with an input or header (UnitHeaderInspectable attribute for header fields) for your ScriptableObject. Start and Stop listening is where you'd subscribe to the event and unsubscribe.