Unity-Technologies/EntityComponentSystemSamples

WithName("RotationSpeedSystem_ForEach") ignored?

JPhilipp opened this issue · 3 comments

Hi! This is more of an understanding question: When in the first HelloCube example, I'm renaming the string within this line to anything else (or remove that line altogether), the program still runs as before, and the cube rotates. So what is the purpose of that line? Thanks!

From the (not-so-easy-to-find) docs: https://github.com/Unity-Technologies/dots/blob/master/Samples/Packages/com.unity.entities/Documentation~/entities_job_foreach.md

WithName(string) — assigns the specified string as the name of the generated job class. Assigning a name is optional, but can help identify the function when debugging and profiling.

Essentially it changes the name of the type we generate for the job struct. For the user this is mostly useful for identifying the job in the profiler.

Thank you! (fyi, I'm getting a 404 on the linked doc page.)

PS: Just as a code-usability note, "WithName(x)" really sounds like you're filtering entities of that name (as in "return entities with that name"). I guess what it is is more like AssignName(x). But maybe that's just me, plus I'm not a native speaker :)