Need hep changing this script to a onclick script.... please help

here is the script
public static class LevelManager
{
private static string lastLevel;

public static void setLastLevel(string level)
{
    lastLevel = level;
}

public static string getLastLevel()
{
    return lastLevel;
}

public static void changeToPreviousLvl()
{
    Application.LoadLevel(lastLevel);
}

}

i want it to load the previous scene on click… kinda like this code that loads a set scene on click.
using UnityEngine;
using System.Collections;

public class LoadOnClick : MonoBehaviour {

public GameObject loadingImage;

public void LoadScene(int level)
{
	loadingImage.SetActive(true);
	Application.LoadLevel(level);
}

}

public static string LastLevel { get; set; }

public static void ChangeToPreviousLvl()
{
    Application.LoadLevel(LastLevel);
}

void Update() {
     if (Input.GetMouseButtonDown(0)) { //0 = right click //1 = left click
          ChangeToPreviousLvl();
     }
}