void play(ParticleInfos pi){ if (pi.bottomSystem) bottomParticleGrp.load (pi.shapeType, pi, -pi.globalOrientation); if (pi.topSystem) topParticleGrp.load (pi.shapeType, pi, pi.globalOrientation); }
void play(ParticleSystem ps, ParticleInfos pi){ //ps.duration = pi.duration / music.tempo * 60; ps.Stop (); ps.startSize = pi.size; ps.startSpeed = pi.speed; if(pi.quantity > 0) ps.Emit (pi.quantity); ps.emissionRate = pi.timeQuantity; ps.Play (); }
public void load(Shape shp, ParticleInfos pi, float orientation){ actualShape = shp; print(pi.globalOrientation); this.transform.localEulerAngles = new Vector3 (orientation, this.transform.localEulerAngles.y, this.transform.localEulerAngles.z); switch(shp){ case Shape.One : { linearPS1.transform.localEulerAngles = new Vector3(0,0,0); print (linearPS1.transform.localEulerAngles); setParticleSystem(linearPS1, pi); break; } case Shape.TwoBotTop : { linearPS1.transform.localEulerAngles = new Vector3(0,45,0); linearPS2.transform.localEulerAngles = new Vector3(0,-45,0); setParticleSystem(linearPS1, pi); setParticleSystem(linearPS2, pi); break; } case Shape.TwoCentTop : { linearPS1.transform.localEulerAngles = new Vector3(0,45,0); linearPS2.transform.localEulerAngles = new Vector3(0,0,0); setParticleSystem(linearPS1, pi); setParticleSystem(linearPS2, pi); break; } case Shape.TwoCentBot : { linearPS1.transform.localEulerAngles = new Vector3(0,0,0); linearPS2.transform.localEulerAngles = new Vector3(0,-45,0); setParticleSystem(linearPS1, pi); setParticleSystem(linearPS2, pi); break; } case Shape.Cone : { conePS.transform.localEulerAngles = new Vector3(0,0,0); setParticleSystem(conePS, pi); break; } case Shape.Circular : { circularPS.transform.localEulerAngles = new Vector3(0,0,0); setParticleSystem(circularPS, pi); break; } default: { break; } } }
public ParticleInfos(float time, ParticleInfos pi){ this.topSystem = pi.topSystem; this.bottomSystem = pi.bottomSystem; this.duration = pi.duration; this.globalOrientation = pi.globalOrientation; this.quantity = pi.quantity; this.timeQuantity = pi.timeQuantity; this.speed = pi.speed; this.size = pi.size; this.shapeType = pi.shapeType; this.time = time; }