void Start() { db = GlobalVars.database; db.AddCharacter(new CharacterData("You")); CharacterData cd = new CharacterData("Sally"); cd.AddTopic(new TopicData("Cookies",topic)); cd.AddAvaliableTopic(0); db.AddCharacter(cd); }
private void ProcessCharacterFileLine(string[] elements, ref CharacterData charTemp) { elements[0] = elements[0].Trim(); // gets rid of leading whitespace switch (elements[0]) { case "name": charTemp.SetName(elements[1]); break; case "bio": charTemp.SetBio(elements[1]); break; case "mood": charTemp.SetMood(int.Parse(elements[1])); break; case "text_color": charTemp.SetTextColor(ProccessColor(elements[1])); break; case "sprite": charTemp.AddSprite((Texture2D)Resources.Load("textures/characters/" + elements[1])); break; case "topic_list": ProcessTopicList(elements[1], ref charTemp); break; case "available_topics": elements = elements[1].Split(','); for (int i = 0; i < elements.Length; i++) charTemp.AddAvaliableTopic(int.Parse(elements[i])); break; } }