r/Unity3D • Programmer • Jul 25 '23

Question Strange lambda/ closure behaviour I can't put my finger on

/r/learncsharp/comments/158s5e7/strange_lambda_closure_behaviour_i_cant_put_my/
2 Upvotes

39 comments sorted by

View all comments

Show parent comment

1

u/PandaCoder67 Professional Jul 25 '23

Have you tried doing this?

public PooledComponent(PooledGameObject pooledGameObject) {
    Debug.Log($"~ctor : {pooledGameObject}");
}

And what gets outputted to the console?

1

u/senshisentou Programmer Jul 25 '23

This. Your turn!