2 Dice Roller

Hi im trying to make a button that will roll two dice beside the button but have both dice come up random. the two dice are guiTexture’s and depending on what the number is the Texture changes to match, its really buggy but it doesn’t give any errors, I was wondering if anyone could point me in the right direction? Here is the code I am Using

RollDice.js
static var hasRolled : boolean;

function OnMouseUp()
{
	hasRolled = true;
}
DiceLogic.js
private var diceTexture : Texture2D;
var number1 : int;
var number2 : int;
var diceOne : Texture2D;
var diceTwo : Texture2D;
var diceThree : Texture2D;
var diceFour : Texture2D;
var diceFive : Texture2D;
var diceSix : Texture2D;
var counter : float;

function Update()
{
	if(Dice.hasRolled == true)
	{
		counter += Time.deltaTime;
		
		if(counter <= 3.0)
		{
			RollDice();
			DiceTextureLogic();
		}
		else if(counter > 3.0)
		{
			counter = 0.0;
			Dice.hasRolled = false;
		}
	}
	
	
}

function RollDice()
{
	number1 = Random.Range(1, 6);
        number2 = Random.Range(1, 6);
}
	
function DiceTextureLogic()
{
	if(number1 == 1|| number2 == 1)
	{
		diceTexture = diceOne;
	}
	else if(number1 == 2|| number2 == 2)
	{
		diceTexture = diceTwo;
	}
	else if(number1 == 3|| number2 == 3)
	{
		diceTexture = diceThree;
	}
	else if(number1 == 4|| number2 == 4)
	{
		diceTexture = diceFour;
	}
	else if(number1 == 5|| number2 == 5)
	{
		diceTexture = diceFive;
	}
	else if(number1 == 6 || number2 == 6)
	{
		diceTexture = diceSix;
	}
	
	this.guiTexture.texture = diceTexture;
}

Thank you in Advance

The way I would recommend handling this is by holding the number textures in an array. You can assign the textures to the array in the inspector and then refer to them from the script:-

var numberTex: Texture2D[];

function RollDice() {
  var d1 = Random.Range(1, 6);
  var d2 = Random.Range(1, 6);

  diceTexture1 = numberTex[d1 - 1];
  diceTexture2 = numberTex[d2 - 1];
}