Need help on converting code for 3D code for 2D.

using UnityEngine;
using System.Collections;

public class EnemyLook : MonoBehaviour {
    public Transform playerPosition;
    public Quaternion rotationAngleX;
    public float TurnSpeed = 5;
    // Use this for initialization
    void Start () {
   
    }
   
    // Update is called once per frame
    void Update () {
        rotationAngleX = Quaternion.LookRotation(playerPosition.position - transform.position);
        transform.rotation = Quaternion.Slerp(transform.rotation, rotationAngleX, Time.deltaTime * TurnSpeed);
    }
}

This does work just great, but works on 3D plane, while I work on 2D game. :frowning:
I just barely worked out to get it working, I seriously have no idea how to get it on 2D plane.

This code can be achieved by:

 Quaternion rotation = Quaternion.LookRotation
             (Target.transform.position - transform.position, transform.TransformDirection(Vector3.up));
         transform.rotation = new Quaternion(0, 0, rotation.z, rotation.w);