// Contacts에 Contact 추가 void AddContact(Contact contact) { if (contacts.HasValue) { Contacts contactsValue = contacts.Value; contactsValue.contactList.Add(contact); } else { List <Contact> contactsList = new List <Contact>(); contactsList.Add(contact); contacts = new Contacts(contactsList); } }
private void Start() { contacts = FileManager <Contacts> .Load(Constant.kFileName); LoadData(); }
private void Start() { contacts = FileManager <Contacts> .Load("Kname"); LoadData(); }
//추가 void AddContact(Contact contact, int k) { if (contacts.HasValue) { if (k == 1) { Contacts playContactList = contacts.Value; playContactList.contactList.Add(contact); spritesListPlay.Add(contact); } if (k == 2) { Contacts killContactList = contacts.Value; killContactList.contactList.Add(contact); spritesListKill.Add(contact); } if (k == 3) { Contacts defenseContactList = contacts.Value; defenseContactList.contactList.Add(contact); spritesListDefense.Add(contact); } if (k == 4) { Contacts stroreContactList = contacts.Value; stroreContactList.contactList.Add(contact); spritesListStore.Add(contact); } } else { if (k == 1) { List <Contact> playContactList = new List <Contact>(); playContactList.Add(contact); spritesListPlay.Add(contact); contacts = new Contacts(playContactList); } if (k == 2) { List <Contact> killContactList = new List <Contact>(); killContactList.Add(contact); spritesListKill.Add(contact); contacts = new Contacts(killContactList); } if (k == 3) { List <Contact> defenseContactList = new List <Contact>(); defenseContactList.Add(contact); spritesListDefense.Add(contact); contacts = new Contacts(defenseContactList); } if (k == 4) { List <Contact> stroreContactList = new List <Contact>(); stroreContactList.Add(contact); spritesListStore.Add(contact); contacts = new Contacts(stroreContactList); } } }