Callback.AddListener dosen't add Listener to EventTrigger

Hey,
I’m trying to add an event type to an event trigger via script. In my main class LoadLevel I’m calling the function SetClickEvent() in the class LoadParts (removed unnecessary parts and transformed to pseudocode)

public class LoadLevel : MonoBehaviour {
    void SpawnParts()
    {
         loop()
         {
              loadP.SetClickEvent();
         }
     }

With SetClickEvent() I create a new EventTrigger.Entry() with the eventID: PointerDown and the function that should be called partSprite.GetComponent<RotateP>().RotatePart((PointerEventData)data);
Then I’m adding this entry to my EventTrigger component.

public class LoadParts {
    public GameObject partSprite;
    public void SetClickEvent()
    {
        EventTrigger.Entry entry = new EventTrigger.Entry();
        entry.eventID = EventTriggerType.PointerDown;
        entry.callback.AddListener((data) => {
            partSprite.GetComponent<RotateP>().RotatePart((PointerEventData)data);
        });
        partSprite.GetComponent<EventTrigger>().triggers.Add(entry);
        Debug.Log("Added event");
    }
}

When I test the code I can see that the entry with the eventID gets added to the EventTrigger but without the listener:
80254-problem.png
What am I doing wrong? Btw. I’m getting no errors and the code already worked when the LoadLevel and LoadParts class were merged together.
Thanks in advanced,
Tobias

It’s a bug in Unity Editor. It won’t show any function assigned in the inspector but it will work. Give it a try.

Have the same problem. It doesn’t show up and after scene reload even the empty event block disappears.