In this section you will learn how to retrieve the contacts lists of the local user and how to add/remove users to the friends/ignore lists.
Loading Contacts
To retrieve the list of contacts from the local user you need to call the LoadFriends method on CombuManager.localUser:
CombuManager.localUser.LoadFriends(
eContactType.Friend, (
bool success) => {
if (success)
Debug.Log("Success: " + CombuManager.localUser.friends.Length);
else
Debug.Log("Failed");
});
Adding Contacts
To add another user to a contact list of the local user you need to call AddContact:
CombuManager.localUser.AddContact(otherUser,
eContactType.Friend, (
bool success,
string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});
CombuManager.localUser.AddContact(
"username",
eContactType.Friend, (
bool success,
string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});
Removing Contacts
To remove a user from the contact lists of the local user you need to call RemoveContact:
CombuManager.localUser.RemoveContact(otherUser, (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});
CombuManager.localUser.RemoveContact("username", (bool success, string error) => {
if (success)
Debug.Log("Success");
else
Debug.Log("Failed: " + error);
});