A new global embedding approach to study Hawking and Unruh effects