public static SocialPlatforms.ILocalUser localUser ;

Description

本地用户(可能未登录)。

在用户登录或对自身进行身份验证前,配置文件数据无效,并且其他任何 Social API 功能都不会运行。

using UnityEngine;

public class ExampleScript : MonoBehaviour { void Start() { Social.localUser.Authenticate(success => { if (success) { Debug.Log("Authentication successful"); string userInfo = "Username: " + Social.localUser.userName + "\nUser ID: " + Social.localUser.id + "\nIsUnderage: " + Social.localUser.underage; Debug.Log(userInfo); } else Debug.Log("Authentication failed"); }); } }