Breakroom is now Sinewave Campus. Book a meeting

SProfile

客户端玩家
在此类中Authorize
  1. 函数
  2. Authorize
  3. LoadProfile
  4. 属性
  5. ActivePlayerProfile
成员 3
函数AuthorizeRequests access to profile functions, must be called prior to attempting to access profile.
函数LoadProfileLoad the profile of player
属性ActivePlayerProfile–

函数​

Authorize​

void Authorize(Closure onAuthorized = null, Closure onRejected = null)
void Authorize(Action onAuthorized = null, Action onRejected = null)

Requests access to profile functions, must be called prior to attempting to access profile. As soon as the player has accepted the request, the Authorized attribute will be 'true'.

参数

名称类型默认值
onAuthorizedClosurenull
onRejectedClosurenull
onAuthorizedActionnull
onRejectedActionnull

返回值

void

示例

Lua
Space.Profile.Authorize()
--or
Space.Profile.Authorize(AnOnAuthorizeFunction)
--or
Space.Profile.Authorize(AnOnAuthorizeFunction, AnOnRejectedFuncton)

LoadProfile​

void LoadProfile(Closure onFinished)

Load the profile of player

参数

参数类型说明
onFinishedCallback FunctiononFinished(SUserProfile) is called once profile is loaded

返回值

void

示例

Lua
function onFinished(SUserProfile)
--
end
Space.Profile.LoadProfile(onFinished)

属性​

ActivePlayerProfile只读​

SUserProfile ActivePlayerProfile {get; }

示例

Lua
Space.Profile.ActivePlayerProfile