object oriented programming was a mistake

ok get this, if you want to change the color of a Unity particle system, you get a reference to ParticleSystem.main, then set the startColor of that to whatever you want. then you do nothing else.

ParticleSystem.main is a struct.

ParticleSystem.main is also read only.

let me reiterate. you ASSIGN A VALUE TO A PROPERTY OF A READ-ONLY STRUCT TO CHANGE AN ACTIVE PARTICLE SYSTEM.

@cai_tan This made me scratch my head even in JavaScript. An object that's a "const" isn't constant at all... you can't reassign it at the root level but you can do whatever you want to its properties, lol
@kaliranya ok so basically in C# you have members (regular ol' variables, you set em and you get em and they just change memory values) but you also have properties, which syntactically operate like variables/members, but are technically actually just two functions in a trenchcoat (a "Get()" and a "Set(value)"). typically you use them if, when someone assigns a value to it, you want to do additional actions, such as updating a UI element or whatever

@kaliranya internally the ParticleSystem.MainModule struct probably only has, like... one member? Probably a reference to the original particle system instance. Then everything else are just {get; set;} properties that, when accessed, read and write to some other internal object used to actually send the data to the GPU and generate the particles.

Basically it's a smoke-and-mirrors way of what really should have been something like ParticleSystem.SetStartColor(Color color)...

@cai_tan
Sounds like a typical day of using unity.