public Friendship GetFriendship(string charName) { for (int i = 0; i < friendships.Count(); i++) { if (friendships.Get(i).character1.characterName == charName) { return(friendships.Get(i)); } if (friendships.Get(i).character2.characterName == charName) { return(friendships.Get(i)); } } Character otherCharacter = GameObject.Find(charName).GetComponent <Character>(); friendships.Add(new Friendship(this, otherCharacter, 0)); otherCharacter.AddFriendship(friendships.Get(friendships.Count() - 1)); return(friendships.Get(friendships.Count() - 1)); }