Open Sliding doors with a button color code

Hello, I don't know if this has been asked yet but I'm trying to have a sliding door open when the player presses a color code onto a keypad using there mouse pointer or cursor if you like.

I have my door animation set up in unity and I think right now it just plays on awake or something like that so as soon as you start the game it has already opened but I would prefer just to make the game more interesting is to have a player first have to discover the key code and then press that into a key pad model, (Which I've yet to make one cobJob at time I figure) ;)

What is the best way to approach something like that?

It'd be much easier if you had given your code so we had something to work with. Still, a pseudo-code, in JS, could look like this:

//create the secretCode array, and a container for the incoming player entry.
var secretCode = new Array(1,3,3,7);
var playerEntry = new Array();

//create a simple button, displaying "1"; and adding "1" to the player entry.
if(GUILayout.Button("1")){ playerEntry.Push(1); }

//compare entry when you're ready for it.
function compareCode(){
    if(playerEntry==secretCode){ print("Entered the correct code!"); }
    else{ playerEntry = new Array(); print("Entered the wrong code!"); } //reset the playerEntry.
}