how should i make dynamic toolbar.
i have finally managed it.But got stuck in some other thing.
here is the code of what i m trying to do
if (Input.GetKey(KeyCode.LeftControl) Input.GetKey(KeyCode.T))
{
Debug.Log(“open new tab bar”);
NewToolString.Add(new Moz(NewToolString.Count,“tab 1”));
toolbarStrings = new string[NewToolString.Count];
for (int i = 0; i < NewToolString.Count; i++)
{
Debug.Log(“ToolBarstring”);
toolbarStrings = NewToolString*.m_Name;*
}
}
_delay = _delay * 15;
}
if (Input.GetKey(KeyCode.Delete))
{
Debug.Log(“Delete” );
NewToolString.RemoveAt(NewToolString.Count);
// toolbarStrings = new string[NewToolString.Count];
}
}
every time i press ctrl+alt new tab opens but the string doest chane i want to change the string from tab 1 to some thing else.and also when i press delete the tab shud get deleted
Do you mean you want the tabs to have names like “Tab 1”, “Tab 2”, etc, as they are created? You could do this by joining the length of the NewToolString array onto the string:-
NewToolString.Add(new Moz(NewToolString.Count,"tab " + NewToolString.Count.ToString()));
The last element of an array has an index number which is 1 less than the array size, so to remove the last element you need to use:-
NewToolString.RemoveAt(NewToolString.Count - 1);
Thanks for the reply.I have done that
Now i am again facing another problem.
I have restricted my tab to 6 after that i press a button to show my other tabs which are open.I am also able to draw that.But not able to change the position of the my first tab so that i can see tab from 2 to 7 instead of 1 to 6.
Hope you understood what I mean to say