public void confetti_particle_at(Vector3 pos) { RotateFadeOutSPParticle tmp = RotateFadeOutSPParticle.cons(proto_confettiParticle); tmp.transform.position = pos; tmp._scmin = 65; tmp._scmax = 65; tmp.set_self_rotation(Util.rand_range(0, 360)); tmp.set_ctmax(100); tmp._alpha.x = 0.8f; tmp._alpha.y = 0.0f; tmp._velocity.x = Util.rand_range(-2, 2); tmp._velocity.y = Util.rand_range(5, 10); tmp.set_vrx(Util.rand_range(-30, 30)); tmp._vr = Util.rand_range(-30, 30); float rnd = Util.rand_range(0, 3); if (rnd < 1) { tmp.set_color(new Vector3(255.0f / 255.0f, 40.0f / 255.0f, 131.0f / 255.0f)); } else if (rnd < 2) { tmp.set_color(new Vector3(255.0f / 255.0f, 192.0f / 255.0f, 40.0f / 255.0f)); } else { tmp.set_color(new Vector3(202.0f / 255.0f, 40.0f / 255.0f, 255.0f / 255.0f)); } m_particles.add_particle(tmp); }
public void ball_move_particle_at(Vector3 pos, float rotation) { RotateFadeOutSPParticle tmp = RotateFadeOutSPParticle.cons(proto_ballTrailParticle); tmp.transform.position = pos + new Vector3(Util.rand_range(-10, 10), Util.rand_range(-10, 10), 0); tmp.set_ctmax(35); float scale = Util.rand_range(25, 100); tmp._scmax = scale; tmp._scmin = scale; tmp._alpha.x = 0.6f; tmp._alpha.y = 0.0f; tmp._vr = 0; tmp.set_self_rotation(rotation); tmp._velocity.x = Util.rand_range(-2, 2); tmp._velocity.y = Util.rand_range(-2, 2); m_particles.add_particle(tmp); }