Search Unity

  1. Unity 2020.2 has been released.
    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

how to send events/messages in 2019.4 (LTS) ?

Discussion in 'Documentation' started by Tom163, Oct 3, 2020.

  1. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,095
    I was surprised to see the event manager apparently gone from 2019 Unity, and no replacement system existing (the new UI message system requires a target).

    I'd like a simple messaging system in my game. With subscribers and being able to trigger events from anywhere without having to link in all the recipients. In 2018 and before I would've used the event manager, but that's gone it seems. So how to do it now in 2019 and 2020?

    Specifically, I have a static class to hold global data, and if at all possible would like to send messages from there as well.


    (having at least one parameter on it would be really nice as well)


    (sidenote: Unity is increasingly being bogged down by so much outdated examples and code on the Internet that doesn't work anymore in the current versions.
     
    Last edited: Oct 3, 2020
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,233
    Are you talking about this one? That was never bundled with Unity, it's just code in a tutorial.
     
  3. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,095
    No. I thought I remember that you can use the Event system to send messages and add subscribers, etc. I might be wrong or confused.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,233
    Do you mean the UI event system?

    In that case you could probably do that, in the same way that you could use a fork to spread butter on bread.
     
unityunity