Exemplo n.º 1
0
    void OnCollisionEnter(Collision collision)
    {
        Instantiate(soundEffect, collision.transform.position, Quaternion.identity);

        GravityObject collisionGravObj = collision.gameObject.GetComponent <GravityObject>();

        if (collisionGravObj.GetID() < GetID())
        {
            AddMass(collisionGravObj.GetMass());
            Destroy(collision.gameObject);
        }
    }