Hi Forum!
EDIT: I have changed approach to how I create arrays, for my server, and apparently this given me severe problems. I now use the layout of the template chatroom by Unity, with this approach:
class Server_Clientlist_Entry
{
var text = "";
var Style = 1;
}
function Server_Clientlist_Add (str : String, Style : int)
{
var entry = new Server_Clientlist_Entry();
entry.text = str;
Debug.Log(entry);
if (Style == 1) entry.Style = 1;
if (Style == 2) entry.Style = 2;
if (Style == 3) entry.Style = 3;
if (Style == 4) entry.Style = 4;
if (Style == 5) entry.Style = 5;
Server_Clientlist_Entries.Add(entry);
Server_Clientlist_ScrollPosition.y = 1000000;
}
This gives me a problem. For some reason, when I try to add lines with this, it prints them right onto the screen, but it stores the name of the class “Server_Clientlist_Entry” in the array, and not the actual string, so I can’t e.g. print or search compare to any index, since all index values are apparently “Server_Clientlist_Entry” … Maybe this is since it uses a class, but how do I avoid this? I want to be able to loop through the index, and check if an entry with the same name already exist. This is an edited thread as I learned more from debugging.
Thanks in advance for your time,
Jeanette