Search Issue Tracker

Fixed in 2020.1

Fixed in 2018.4, 2019.2, 2019.3

Votes

8

Found in

2019.2.1f1

2019.2.5f1

2019.3.0a12

2020.1.0a1

Issue ID

1178687

Regression

Yes

UnityEvent drawer no longer handles events in non-public fields correctly

uGUI

-

How to reproduce:
1. Open the attached "Event_Listener_Bug.zip" project
2. Open "SampleScene"
3. Select the "Listener" in the Hierarchy
4. In the Player Input component inspector, open the "Events" and "Player" foldouts
5. Try to set the Fire() event listener to Script.Click()

Expected results: The Script.Click() method can be chosen
Actual results: Only static parameters can be chosen

Reproducible with: 2019.2.7f1, 2019.3.0b1, 2020.1.0a2
Not reproducible with: 2018.4.7f1, 2019.2.3f1, 2019.3.0a11

Comments (49)

  1. 4cd7d44f8da08e4f10462b30de15fccb?d=mm

    Domas_L

    Oct 22, 2019 17:48

    Hello! It seems that the issue was only partially fixed, and in some cases, in particular when the class is derived from another class, the issue can still be reproduced. This issue is now being tracked, and you can follow its progress here: https://issuetracker.unity3d.com/is...-when-the-class-is-derived-from-another-class

  2. B3a079327cfa4f85367ccdee4731a078?d=mm

    mnarimani

    Oct 18, 2019 12:07

    Issue still exists in 2019.2.9

  3. Fb2caa50e82513b242a0f007a9c29926?d=mm

    eprovencher

    Oct 15, 2019 16:56

    It seems that there are 2 bugs here. The private field bug may have been fixed, but dynamic method parameters from events are still not fixed.
    https://forum.unity.com/threads/2018-4-9f1-doesnt-show-dynamic-methods-for-events.758357/

  4. Fb2caa50e82513b242a0f007a9c29926?d=mm

    eprovencher

    Oct 15, 2019 14:21

    Just downloaded 2018.4.11, and the issue is still present with UnityEvents trying to pass dynamic parameters via public functions.

  5. E1d5009c5868810cb6f2de0fa9d846cb?d=mm

    Elringus

    Oct 13, 2019 17:18

    Still not fixed in 2019.2.9f1.

  6. Fdd8c3da593707cdf752050c52342403?d=mm

    madTeddy

    Oct 07, 2019 14:46

    Yep, same problem in 2018.4.10f1

  7. E1d5009c5868810cb6f2de0fa9d846cb?d=mm

    Elringus

    Oct 05, 2019 16:22

    2019.2.8f1 patch didn't fix the issue completely. Some methods are still missing, eg can't assign Animator.SetTrigger(string) to a UnityEvent<string> so that the event argument is automatically routed to the handler.

  8. B6d432a25d4935b54b25d121e16af005?d=mm

    P_Jong

    Oct 05, 2019 14:33

    This is now fixed for me in Unity 2019.2.8f1. But I had to re-build a lot of my Script.Click() methods. Not all but many of them. Can anyone else validate this?

  9. 4956de76d1a1adb9a25a22f03dc59854?d=mm

    MichaelHeiml82

    Oct 04, 2019 09:40

    Also happens in 2018.4.10f1

  10. Af4dbd09f37426e4f75088010e2a9e89?d=mm

    pnelsonic

    Oct 03, 2019 20:25

    Also occurs in 2018.4.9f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.