Particle system mesh emitter

How can I change this option during runtime?

[33415-screenshot+2014-10-08+17.20.27.png|33415]

EDIT: Since that doesn’t work, does anybody know a workaround? Like another particle system or something.

2 Answers

2

So, I found the answer:

	var GrassSystem = Chunk.GetComponent("ParticleSystem");
    var so : SerializedObject = new SerializedObject(GrassSystem);
	so.FindProperty("ShapeModule.m_Mesh").objectReferenceValue = mesh;
	so.ApplyModifiedProperties();
	GrassSystem.particleSystem.Play();

So I eat my words! Congratulations! How did you find this property? I tend to look for this stuff with .NET Reflector, but maybe I overlooked it? I'd love to see how your grass generation goes. Keep me in the loop.

I found it here: http://forum.unity3d.com/threads/accessing-all-shuriken-particlesystem-properties-from-scripts.204153/ And will try to keep you updated. :) BTW, now I am stuck at how I can only apply it to some places, example not on rock textured surfaces and it could actually handle 90000 particles (With frustum culling) So many of them might not get rendered.

How do you blend your surface textures? Do you use colored verts?

I'm not sure what you mean, on the grass or on the terrain? Do you mean how I make it apear someplaces and not others, because I haven't figured that part out yet.

So I just found a problem with my own solution, I can't build. It just gives me this error: BCE0005: Unknown identifier: 'SerializedObject'.

Unfortunately you can’t. The Shuriken API simply doesn’t expose this feature.

Is there any way to get around, does your particle emitter have this feature?