- Home /
How to use RequireComponent with ParticleEmitters?
My C# script looks like this:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof (ParticleEmitter))]
public class my_class : MonoBehaviour {
// ...
}
If I add the script it to a game object it creates an error telling me that Unity can not add a ParticleEmitter component, because there are only the derived MeshParticleEmitter or the EllipsoidParticleEmitter actually available as components. However, there are no MeshParticleEmitter or EllipsoidParticleEmitter classes that I could use in the RequireComponent command.
So how do you correctly require, lets say, an elliptical particle emitter component?
Thank you!
Answer by Bunny83 · Jul 01, 2011 at 05:17 PM
You can't at the moment. The particle emitter classes are internal classes. They aren't even part of the managed dll so there's no way to access those classes via scripting.
http://answers.unity3d.com/questions/34615/how-do-i-access-the-extra-variables-in-a-mesh-part.html
Thank you. A strange thing. I'll look for a workaround then.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
All instances of particle emitter prefab are emitting when emit=true 0 Answers
Particles Won't Destroy 1 Answer