Can you explain this method call syntax to me?

this.mainParticleSystem.Simulate(time, withChildren: false, restart: true);

Particularly I don't understand what withChildren: false parameters syntax means. Is it some kind of default value or something?


These are Named Arguments.

They were introduced together with optional arguments in C# 4.0 (VS 2010). Apparently the goal was not so much to support people who forget the order of method parameters, but to allow calling methods with many parameters while specifying only a few of them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.