Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Event handles

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

  1. Tyndareus

    Tyndareus

    Joined:
    Aug 31, 2018
    Posts:
    29
    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

    JasonJonesLASM

    Joined:
    Sep 5, 2012
    Posts:
    210
    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 -> https://lifeandstylemedia.com/docs/manual/entries/bolt/tutorials/CustomUnits_Introduction.php

    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.
     
unityunity