Exemplo n.º 1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.name == name)
        {
            ba = collision.gameObject.GetComponent <BallEvolution>();
            if (collision.transform.position.y < transform.position.y)
            {
                ba.Spawner = false;
            }
            else
            {
                Spawner = false;
            };


            if (Spawner)
            {
                SpawnBall(thisNumber, GetRightObj(thisNumber));
                SA.AddScore(this.thisNumber);
            }

            Destroy(gameObject);
        }
    }