Ok, I am new to C# so I apologize for the extremely newb questions, just trying to figure this out.
I know how to create GUI buttons and how to execute some action on clicked, basic stuff. However, for slightly more advanced things I am completely clueless.
Say I want to make a button move:
GUI.Button(new Rect(x, y, w, h), "Text")
I know the Rect x is what I want to affect, but I have no idea how to access it. I am more familiar with actionscript (wanting to learn C# btw) so I want to do something like
button = GUI.Button(new Rect(x, y, w, h), "Text")
button.x = 25;
I am thinking this is not correct. Further more I know there is a way to pre set the Rect information, but so far I have not locked down the syntax.
public new Rect myRect;
myRect = x,y,w,h;
GUI.Button(myRect, "Text")
Also, I am trying to create GUI elements during runtime, which simple tests with prefabs is working. However, I cannot figure how to check if I have already instantiated the prefab, so I do not make another.
I have further questions, such as the alpha of a button, but I am thinking if I can get some direction for the position I can learn to affect other parts.
Sorry again, I am reading and watching tutorials and learning a great deal – but the C# logic still confuses me, trying to get used to it.
Thanks