Why are these elements in a List empty?
I instantiate the chat class in this function and add it to a List. but inspector shows that the elements in the list are empty. Why are the elements None(Chat)? Anyone know what i'm missing here? thanks
public void createEveryChatForPerson(Person person){
person.stringScripts = dialogueLoader.LoadPersonsScriptsString(person.Name);
foreach(string script in person.stringScripts){
Chat chat = new Chat(chatPrefab,parentObjectForChats);{
chat.chatScript.SetDialogue(script);
chat.chatScript.setRecipient(person);
chat.chatScript.setOwnersFromScript(chat.chatScript.DialogueScript);
chat.setChatName();
}
person.chats.Add(chat);
}
}
sieppaa.jpg
(34.7 kB)
Comment