Rotate camera and player with mouse 2d top-down shooter in C#

Hi guys,so here is the problem i would need help with.I make a topdown shooter and the idea is,if you move the mouse the camera and player rotates,so basically the player always looks in the same direction,and the ground “rotates”.I have already did that part when you rotate the camera in inspector(z axis) the player follows, but i cant write a proper function to rotate the camera with mouse.

Here is my code:

Player:

 void Update()
 {  

     var CharacterRotation = Gamecam.transform.rotation;
     CharacterRotation.x = 0;
     CharacterRotation.y = 0;

     transform.rotation = CharacterRotation;

 }

Camera(after hours of searching in forums,still not working properly):

  public GameObject player;


 private Vector3 offset;

 public Vector3 playerPos;



 // Use this for initialization
 void Start () {
     offset = transform.position - player.transform.position;

 }

 private void Update()
 {
     // Get Angle in Radians
     float AngleRad = Mathf.Atan2(Input.mousePosition.y - transform.position.y, Input.mousePosition.x - transform.position.x);
     // Get Angle in Degrees
     float AngleDeg = (180 / Mathf.PI) * AngleRad;
     // Rotate Object
     this.transform.rotation = Quaternion.Euler(0, 0, AngleDeg * 2);
 }

 // Update is called once per frame
 void LateUpdate () {
     transform.position = player.transform.position + offset;
 }

I come late for this post,but where u put float AngleRad = Mathf.Atan2(Input.mousePosition.y - transform.position.y, Input.mousePosition.x - transform.position.x);, u should add “Mathf.Rad2Deg”.

Just like this:

float AngleRad = Mathf.Atan2(Input.mousePosition.y - transform.position.y, Input.mousePosition.x - transform.position.x)*Mathf.Rad2Deg;

And in LateUpdate()
transform.rotation= Quaternion.Euler(0,0,AngleDeg*rotationSpeed);

3 years late but maybe helps somebody else xD.