|
So essentially, what I want to do is highlight the button I press. I have got a way to do it but the problem is that my frame rate goes from 300 to 10 whenever I press a button. Here is what I did, but is there a better way to do it? I couldn't figure out how to just swap textures so this is the long way: This does work. Its just not efficient in the least. SOLVED: Essentially this is the change I made:
(comments are locked)
|
|
you can have variables with the different images of your buttons, pressed and unpressed, this will give you like 7 images 5 of 'g-h-v-b-n' unpressed, and 2 of 'g-h' pressed you only have the GUI.DrawTexture() once, but having a texture that will change its image value, once the button is pressed
this is the main idea of what i would do, also instead of drawing on the OnGUI, i would change that for a plane object, with the plane you will need change the material, as i know is more efficient than OnGUI, but first make the try hope this helps you Ah, thats close to what I was doing. I was wondering if I could search through the project to find a texture and assign it to one variable so that I don't have to allocate 7 images. And even then, would that fix the 300 to 10 frames issue?
May 09 '11 at 05:06 PM
SirGive
Ahh I missed that last part. Thanks, I'll give it a shot.
May 09 '11 at 05:07 PM
SirGive
actually instead of the assigment it could be a Resources.Load("myimage") as Texture or something, i think the frame rate problem should not be there anymore, if dont work with that, try the planes thing
May 09 '11 at 05:29 PM
poncho
That is awesome. This totally fixed the problem. Thank you.
May 10 '11 at 07:45 PM
SirGive
(comments are locked)
|

