public void SpawnScorePoint(uint point, Vector3 position) { ABParticle scoreParticle = _scoreEmitter.ShootParticle(); if (!scoreParticle) { return; } scoreParticle.transform.rotation = Quaternion.identity; scoreParticle.transform.position = position; Text pointText = scoreParticle.GetComponent <Text>(); pointText.text = point.ToString(); HUD.Instance.AddScore(point); }
public ABParticle ShootParticle() { ABParticle inactiveParticle = _particles.GetFreeObject(); if (inactiveParticle != null) { float mass = Random.Range(_minMass, _maxMass); 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.mass = mass; inactiveParticle.Shoot(velocity, lifetime, _applyGravity, _addNoise); } return(inactiveParticle); }
public void SpawnScorePoint(uint point, Vector3 position) { //GameObject edt = GameObject.Find("ModoEditor"); //if (edt != null) return; //if (_scoreEmitter != null) { ABParticle scoreParticle = _scoreEmitter.ShootParticle(); if (!scoreParticle) { return; } scoreParticle.transform.rotation = Quaternion.identity; scoreParticle.transform.position = position; Text pointText = scoreParticle.GetComponent <Text>(); pointText.text = point.ToString(); HUD.Instance.AddScore(point); //} }
public void AddTrajectoryParticle(ABParticle trajectoryParticle) { _birdTrajectory.Add(trajectoryParticle); }
private void InitParticle(ABParticle particle) { particle.Create(this); }
public void KillParticle(ABParticle particle) { _particles.SetFreeObject(particle.gameObject); }