Version: 2020.1
public void LoadFriends (Action<bool> callback);

描述

获取已登录用户的好友列表。如果此调用成功,则系统会填充 Social.localUser 实例上的好友列表。

using UnityEngine;
using UnityEngine.SocialPlatforms;
using System.Collections;

public class Example : MonoBehaviour { void Start() { Social.localUser.LoadFriends(success => { Debug.Log(success ? "Loaded " + Social.localUser.friends.Length + " friends" : "Loading friends failed"); }); } }