Task: a : for mobile device ( MouseDown, MouseUp etc limit the Update events) b : every button (white/blue) toggle color and pop-up menu (same plane different texture ) c : only one button can be active at a time default position no active buttons d : no other buttons for toggle info off and on!! e : adjustable for different count of a button Task A and B is so simple that it hurts but the rest is killing me ;(. I solve A and B many different ways but last it looks like this: - every button has C# that toggle bool in one C# script "Button_List" with Update(only one update for this taks) . - Button_List(C#) do the rest ; if BtnA=true , set active "info_Container" change texture to InfoA. If BtnA=false hide "info_Container" . I do not have to change back texture because another button load different one so this is OK, but i can press many buttons after a while its mess Array of bools looks promising but If every button is a toggle i can't make eg: MouseDown set array = false , MouseUp set BtnA true. This is good solution and I have only one Btn On, but I cant set this one to false by toggle because on MouseDown all are false so one is always active. My brain melts
ok mayby i help Now the code check of I click on buton with value i=0 and only that one is toggle rest of them turn blue and false when i change buton but no toggle ;(. I need some function if i== button that is true then toggle if i click other one then turn off them all and only turn on this one. Code (CSharp): void OnMouseDown () { GameObject[] buttons = GameObject.FindGameObjectsWithTag("Info_buttons"); for(var i=0; i<buttons.Length; i++){ if(i!=0){ buttons[i].GetComponent<InfoBTN>().Press = false; buttons[i].renderer.material.color = Color.blue; } } } void OnMouseUp () { if(gameObject.name=="Btn01"){ Press = !Press; if(Press){ Btn01.renderer.material.color = Color.red; } if( !Press){ Btn01.renderer.material.color = Color.white; } }