how can i do table view?
I want left click on latency and sort by latency. Or left click on players sort by players ascend.
I did a lot of research on the internet. But I could not find an easy and convenient TableView.
I want, Example:
highlight in row
How can I do the easiest thing like that?
For the sorting of different things as Server Name, Player Count, Map, etc. If you have each tabs information stored as a List, they have an easy function called Sort();
public List<TabInformation> tabInformationList; //This list will hold all the tabs in the table.
private struct TabInformation
public string serverName;
public int playerCount;
public int latency;
private enum SortMode
public void SortTabList(SortMode mode)
//Then just refresh the list, and replace each tab according to the new list.
private int SortByName(TabInformation i1, TabInformation i2)
private int SortByPlayers(TabInformation i1, TabInformation i2)
private int SortByLatency(TabInformation i1, TabInformation i2)
I would use something like this, if it was up to me. For the rest part, by clicking and adding stuff, place a script on each tab, which also might make it easy to manipulate them and get their information. I hope this helps some, otherwise feel free to always ask.
As for adding more, have an item as a prefabrication which you always can instantiate, then have a function called something like EstablishList(string name, int playerCount, int latency). Which will handle displaying the right information.