using UnityEngine;
using System.Collections;

public class GenieDeathParticleBurst : MonoBehaviour {
	public float gravityMult;
	ParticleSystem ps;
	ParticleSystem.Particle[] particles;

	void Awake () {
		ps = GetComponent<ParticleSystem>();
		particles = new ParticleSystem.Particle[ps.maxParticles];
	
	}
	
	// Update is called once per frame
	void Update () {
		int numParts = ps.GetParticles(particles);
		for (int i=0;i<numParts;i++)
		{
			ParticleSystem.Particle p = particles[i];
			p.velocity = p.velocity + (p.position.normalized * gravityMult * -Time.deltaTime);
			particles[i] = p;
		}
		ps.SetParticles(particles,numParts);
	}
}
