Search Unity

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,290
    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:
    6,334
    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,290
    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:
    6,334
    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.