I have an old project which contains ParticleEmitter implemented.
public ParticleEmitter Spawn(ParticleEmitter prefab,
Vector3 pos, Quaternion rot)
{
// Instance using the standard method before doing particle stuff
Transform inst = this.Spawn(prefab.transform, pos, rot);
// Can happen if limit was used
if (inst == null) return null;
// Make sure autodestrouct is OFF as it will cause null references
var animator = inst.GetComponent<ParticleAnimator>();
if (animator != null) animator.autodestruct = false;
// Get the emitter
var emitter = inst.GetComponent<ParticleEmitter>();
emitter.emit = true;
this.StartCoroutine(this.ListenForEmitDespawn(emitter));
return emitter;
}
So what I require to change to make this work?