Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ButtonNode[] bn = null;
- void OnGUI()
- {
- GUILayout.BeginHorizontal();
- if (bn == null)
- {
- bn = new ButtonNode[10];
- for (int i = 0; i < bn.Lenght; ++i)
- {
- bn[i] = new ButtonNode();
- }
- }
- for (int i = 0; i < bn.length; i++)
- {
- // this line has to be removed, to avoid recreation of buttons
- // bn[i] = new ButtonNode();
- if (bn[i].button = GUILayout.Button(bn[i].name + i, GUILayout.Width(bn[i].sizeW)))
- {
- bn[i].AlterButton();
- }
- }
- GUILayout.EndHorizontal();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement