|
Hey guy's, I'm still working on that Inventory stuff! My issue today, is with GUI.Button. Iv scavenged around online, and have tried to CopyPasta example code, and even that doesn't work! So, What I'm trying to do is when the game pauses, I have a series of buttons that pop up. Those button's are created by reading the player's inventory value, and returning buttons. The problem is, the GUI.Button command always returns errors. (error CS0119: Expression denotes a Here's some code clips, to help bring the problem to light... Everything works fine until it's time to create a button. This did not work, even before I threw in the For Statement, I was just trying to find another work around before I asked. Any help is appreciated guys! Thanks!
(comments are locked)
|
|
of what type is the variable heal1items? I think you are feeding an int in the Button where it expects a String? Maybe try GUI.Button(Rect(...), heal1items.ToString()); Greetz, Ky. Edit: Sorry, just saw that the typing is right there in the script -.-' d'oh... Edit2: No, wait. heal1Texture is declared in the script, heal1items isn't... oO dear lord, I better go to bed... sorry I'm no help... >_< heal1items is a Texture2d. Im trying to buttons with textures on them.
Jul 13 '11 at 11:16 PM
PrezThompkins
Hmm... two thoughts... 1. I think it should be Texture instead of Texture2D for a GUI-Texture (?), 2. how do you compare i : int with a Texture2D in your for-loop? Greetz, Ky.
Jul 13 '11 at 11:23 PM
SisterKy
The for loop is something I just threw in there, it doesn't work outside of the loop iether. Iv switched it back to just Texture, issue still comes up. I'm thinking I'v missed something that should be obvious.
Jul 13 '11 at 11:49 PM
PrezThompkins
(comments are locked)
|
|
can you write down a full script for this?
(comments are locked)
|
