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.

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)
	else {
		if (page - 1 < 0)
    var newPage : Texture = Resources.Load(baseName+page) as Texture;
    if (newPage != null) {
       var lastPage = renderer.material.mainTexture;
       renderer.material.mainTexture = newPage;
    else {
    	page = currPage;

function OnGUI() {
	if (GUI.Button(Rect(0,0,100,50),"Next"))
	if (GUI.Button(Rect(0,75,100,50), "Prev"))