Texture2d Array with Next Button

Hi everyone,

I’m new to Unity and using it for a graduate school project to create a scene based on a book. What I’m trying to do is create an array of several texture2ds (about 100) with a next and previous button so you can examine the textures like you would be flipping through a book. Right now my code is that I have a texture2d that pops up when you click on the book object, but I can’t figure out the array. I’d really appreciate any help.
Thanks!

Here is some modifications to the code from your last question. Call NextPrevPage(true) to go to the next page, Call NextPrevPage(false) to go to the previous page. Replace this script with the one you use to text the Quad as outlined by my comments.

#pragma strict
 
var baseName = "Page";
private var page = 0;
var lastPage = 100;
 
function NextPrevPage(nextPage : boolean) {
	var currPage = page;
	
	if (nextPage) {
		if (page + 1 > lastPage)
			return;
		page++; 
	}
	else {
		if (page - 1 < 0)
			return;
		page--;
	}
	
    var newPage : Texture = Resources.Load(baseName+page) as Texture;
    if (newPage != null) {
       var lastPage = renderer.material.mainTexture;
       renderer.material.mainTexture = newPage;
       Resources.UnloadAsset(lastPage);
    }
    else {
    	page = currPage;
    }
}

function OnGUI() {
	if (GUI.Button(Rect(0,0,100,50),"Next"))
		NextPrevPage(true);
	if (GUI.Button(Rect(0,75,100,50), "Prev"))
		NextPrevPage(false);
}