Rotate Camera using a joystick or buttons

Hello Everyone,
I’ve been struggling with this problem,
I have a working FPS Camera script attached to a camera and capsule I want to transfer it to a joystick or buttons
this is my script :

``````        using UnityEngine;
using System.Collections;

public class MouseLook : MonoBehaviour
{

public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 15F;
public float sensitivityY = 15F;

public float minimumX = -360F;
public float maximumX = 360F;

public float minimumY = -60F;
public float maximumY = 60F;

float rotationY = 0F;

void update()
{
if (axes == RotationAxes.MouseXAndY)
{
float rotationX = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;

rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);

transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
}
else if (axes == RotationAxes.MouseX)
{
transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
}
else
{
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);

transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
}
}
}

I already have Left Right Up Down buttons in a Canvas how can I transfer the script so I can rotate it with buttons
``````

thank you so much

In the inspector, go to Edit>Project Settings>Input. This should open the input manager. From here, increase the amount of inputs to however many more you require. Then, for each of these new inputs, rename them to the inputs used (i.e. “Mouse X”, “Mouse Y”). Then, configure these inputs to use different buttons/axis’. As long as they have the same name, Unity will automatically search for input from all of these at once.

At the bottom of the following link are the general names and such that you can set;