public SMBParticle ShootParticle() { SMBParticle inactiveParticle = _particles.GetFreeObject(); if (inactiveParticle != null) { float randVel = Random.Range(_minVel, _maxVel); float randAng = Random.Range(_minAngle, _maxAngle) * Mathf.Deg2Rad; float lifetime = Random.Range(_minLifetime, _maxLifetime); Vector2 velocity = new Vector2(Mathf.Cos(randAng), Mathf.Sin(randAng)) * randVel; inactiveParticle.Shoot(velocity, lifetime, _applyGravity, _gravityFactor, _bounds); } return(inactiveParticle); }
public void KillParticle(SMBParticle particle) { _particles.SetFreeObject(particle.gameObject); }
private void InitParticle(SMBParticle particle) { particle.Create(this); }