I have been looking everywhere for this, but to no avail. Basically, how do you access the mesh variable within the shape module on the new Shuriken particle emitters? The current documentation on Shuriken in the script reference (here: http://unity3d.com/support/documentation/ScriptReference/ParticleSystem.html) has no reference to variables in other modules other than the Initial Module.
The reason I’d like to access it through script is because I am wanting to procedurally generate meshes for volumetric cloud systems. If there is actually no way to access it, well I suppose I’d need to go back to the drawing board …
Sorry for the long post size … I’m not great at being succinct!
I’m using Unity 4, and this doesn’t seem to be in yet. I can’t find documentation for it either.
I’m fairly annoyed that “legacy” is used to describe the only fully-functional particle system. I would have gone with the old system from the get-go with if wasn’t called “Legacy” and Shuriken was called “Beta” instead.
If you still want it, and because there was a reply 10days ago:
SerializedObject so = new SerializedObject(GetComponent<ParticleSystem>());
so.FindProperty("ShapeModule.m_Mesh").objectReferenceValue = myMesh;
so.ApplyModifiedProperties();
May require “using UnityEditor;”
You can basically access everything in the ShurikenSystem with that, see:
Shuriken seems to deal with the mesh being modified at runtime, so I’ve just created an empty mesh asset, hooked it to both the emitter and the script component which creates the vertices. It’s a silly hack for something that should have been exposed, and I haven’t found a way to get multiple instances of a emitter prefab with unique mesh data.
Something I noticed was that it will only emit for vertices on triangles, so I’ve had to create fake triangles for my point cloud. Setting indices with ‘point’ topology caused Unity to crash (4.2.1).