Actually you don't need a Lambda function

Just one small suggestion. In the case of registering listeners you don’t need a lambda function that calls another function.

You can easily turn this:

nextButton.onClick.AddListener(() => playerConversant.Next);

into

nextButton.onClick.AddListener(playerConversant.Next);

It’s kind of the same, but a little less verbose which is always nice

2 Likes

You’re quite right.

I think Sam was just showing us a Lambda example, albeit not a necessary one in this case.

Privacy & Terms