示例#1
0
    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);
    }
示例#2
0
    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);
    }
示例#3
0
    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);
        //}
    }
示例#4
0
 public void AddTrajectoryParticle(ABParticle trajectoryParticle)
 {
     _birdTrajectory.Add(trajectoryParticle);
 }
示例#5
0
 private void InitParticle(ABParticle particle)
 {
     particle.Create(this);
 }
示例#6
0
 public void KillParticle(ABParticle particle)
 {
     _particles.SetFreeObject(particle.gameObject);
 }