Hi!
This makes no sense (At least for me! haha) The question is, I have a Listt of button I created with an array,everything is ok 'til here. I want each of those buttons to create more buttons from another array (I have an array called Section with all sections, and it has Name and Subsections, which is another Array with all subsections, this is what I want to show) The problem is, it works if I can show the subsections with a Debug.Log, and the button is working obviously, I can also hide the GUI or whatever, but not create any button!! and that’s what I need!, here is the Script.
var Side : Texture2D;
var Up : Texture2D;
var customGuiStyle : GUIStyle;
var AllSections : Section[];
function OnGUI(){
GUI.DrawTexture(Rect(0,75,200,725),Side);
GUI.DrawTexture(Rect(0,0,480,75),Up);
for (var i=0;i<TodasSecciones.length;i++){
if(GUI.Button(Rect(0,75+(i*50),200,50),""+AllSections*.Name, customGuiStyle)){*
-
//This is working*
-
Debug.Log("Hi");*
-
//But this is not*
*if(GUI.Button(Rect(200,75,200,50),“Hi”, customGuiStyle)){} *
for (var j=0;j<AllSections*.Subsections.Length;j++){*
//this is working too
Debug.Log(AllSections*.Subsections[j].Title);*
//but this is not
if(GUI.Button(Rect(200,75+(j50),200,50),“”+AllSections.Subsections[j].Title, customGuiStyle)){*
* }*
* }*
* }*
* }*
}
Help! Thank you!!!