Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cybergoogle

Pages: [1]
1
NGUI 3 Support / Re: Randomly generate Texture array.
« on: May 12, 2014, 04:15:19 PM »
I solved the problem by just creating a plane and adding a texture. I then attached the random texture script and just made it fit an ipad screen i'll adjust according to screen size I suppose. I'm using a ngui button but I couldn't figure out how to use the NGUI UITexture with this script. Thanks for the help anyways.

2
NGUI 3 Support / Re: Randomly generate Texture array.
« on: May 05, 2014, 05:40:40 PM »
Tried that code in both javascript and c# UITexture script but did not work and gave compiler errors.

I have a UITexture prefab in the scene and I want that texture to change randomly whenever the scene is started. I am making a mobile app and when a user touches a button that opens this scene I want a texture to randomly generate I have 31 images.

Do I edit the Texture script? (UITexture)?

I created a scene without using NGUI used a plane and placed a texture on top and used the code I had above and it worked however the sizing on the ipad mini and android is off and the ngui button is off as well since there are two cameras when I use the camera looking at the textured plane and the NGUI button prefab.

Any suggestions?

3
NGUI 3 Support / Randomly generate Texture array.
« on: May 05, 2014, 01:55:23 AM »
I would like to create a texture array using the UITexture prefab provided with NGUI however; it's not working out. I am unfamiliar with c# and created a script using javascript that creates an array in the inspector but nothing happens.

The idea is that upon the start of the scene I would like to generate a random texture 0-31.

here is my code so far.

#pragma strict

var itemTextures : Texture[];

function Start () {

renderer.material.mainTexture = itemTextures[Random.Range(0, 31)];

}

The texture array appears in the inspector I assign textures to all the elements 0-31 but nothing happens when I click play. I attached Mesh Renderer as I was getting compiler errors asking for that. No compiler errors but nothing happens. No textures are showing up just blank screen.

Please help. Pardon for I am a noob at programming. =(

Pages: [1]