Okay, this is really odd, and I can’t figure it out at all. I’m assuming it’s a bug somewhere within Unity. But check this out:
I have two lists:
var ProfileUsername : List.<String>;
var ProfileSubtext : List.<String>;
I then have this function that creates a new profile, it just adds new entires into the list:
public function AddNewProfile(){
print("[PROFILE] Add new profile");
ProfileUsername.Add("New Name");
ProfileSubtext.Add("Subtext tag");
print("Username Count: " + ProfileUsername.Count);
}
Whats weird is that is puts both ‘New Name’ and ‘Subtext tag’ into my ProfileUsername, and ProfileSubtext:
How is this happening? My print ‘Username Count’ also returns a count of 2 entries .
UPDATE
In fact, it adds it to all my List variables within my script.