Class Player
Inheritance
Inherited Members
Namespace: StoryVerse
Assembly: Assembly-CSharp.dll.dll
Syntax
public class Player
Constructors
Player()
Constructor for the player object when instantiated.
Declaration
public Player()
Fields
LoginOptions
This is the default login options, this is also used when refreshing data for the player.
Declaration
public GetPlayerCombinedInfoRequestParams LoginOptions
Field Value
Type | Description |
---|---|
PlayFab.ClientModels.GetPlayerCombinedInfoRequestParams |
OnGetCharacter
This event is fired when character is fetched
Declaration
public PlayFabCharacterEvent OnGetCharacter
Field Value
Type | Description |
---|---|
PlayFabCharacterEvent |
OnGetCharacterError
This event is fired when failed to download Character for this show
Declaration
public PlayFabErrorEvent OnGetCharacterError
Field Value
Type | Description |
---|---|
PlayFabErrorEvent |
OnGetLoginReward
Declaration
public UnityLoginRewardEvent OnGetLoginReward
Field Value
Type | Description |
---|---|
UnityLoginRewardEvent |
OnGetLoginRewardError
Declaration
public PlayFabErrorEvent OnGetLoginRewardError
Field Value
Type | Description |
---|---|
PlayFabErrorEvent |
OnLinkingError
This event is fired after an error has occured during linking or unlinking, check PlayFabError.Error for the reason why. PlayFabError.Error is an enum, which contains all possible reasons for playfab errors.
Declaration
public UnityEvent<PlayFabError> OnLinkingError
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<PlayFab.PlayFabError> |
OnLinkSuccess
Event is fired when a successful linking has occurred.
Declaration
public UnityEvent<bool> OnLinkSuccess
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<System.Boolean> |
OnLogin
This event is fired after a successful login attempt.
Declaration
public UnityEvent<LoginResult> OnLogin
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<PlayFab.ClientModels.LoginResult> |
OnLoginError
This event is fired after an error has occured during login, check PlayFabError.Error for the reason why. PlayFabError.Error is an enum, which contains all possible reasons for playfab errors.
Declaration
public UnityEvent<PlayFabError> OnLoginError
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<PlayFab.PlayFabError> |
OnLoginPrompt
This event will fire if subscribed to, and will allow you to prompt for authentication types.
Declaration
public UnityEvent OnLoginPrompt
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent |
OnRefreshCurrencies
This event is fied when currencies were succesfully refreshed
Declaration
public UnityEvent OnRefreshCurrencies
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent |
OnRefreshCurrenciesError
This event is fired when failed to update currencies.
Declaration
public PlayFabErrorEvent OnRefreshCurrenciesError
Field Value
Type | Description |
---|---|
PlayFabErrorEvent |
OnRefreshFailure
This event is fired after an error has occured during a refresh, check PlayFabError.Error for the reason why. PlayFabError.Error is an enum, which contains all possible reasons for playfab errors.
Declaration
public ErrorUnityEvent OnRefreshFailure
Field Value
Type | Description |
---|---|
ErrorUnityEvent |
OnRefreshInventory
This event is fired any time Inventory Items are changed on PlayFab. Only triggered after a Refresh()
Declaration
public ItemsChangedUnityEvent OnRefreshInventory
Field Value
Type | Description |
---|---|
ItemsChangedUnityEvent |
OnRefreshInventoryError
This event is fired when failed to call RefreshInventory
Declaration
public PlayFabErrorEvent OnRefreshInventoryError
Field Value
Type | Description |
---|---|
PlayFabErrorEvent |
OnStarsChanged
This event is fired any time Stars values are changed on PlayFab. Only triggered after a Refresh()
Declaration
public UnityEvent<int> OnStarsChanged
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<System.Int32> |
OnTicketsChanged
This event is fired any time Tickets values are changed on PlayFab. Only triggered after a Refresh()
Declaration
public UnityEvent<int> OnTicketsChanged
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<System.Int32> |
Properties
AuthToken
Set this value when using Google, Facebook or GameCenter authentication. It must be set prior to calling Login([AuthType]).
Declaration
public string AuthToken { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CurrenciesState
Declaration
public CurrenciesState CurrenciesState { get; set; }
Property Value
Type | Description |
---|---|
CurrenciesState |
Inventory
Returns a readonly list of Inventory (a.k.a. in PlayFab ItemInstance)
Declaration
public Inventory Inventory { get; }
Property Value
Type | Description |
---|---|
Inventory |
Stars
Returns how many Stars the current user has
Declaration
public int Stars { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Tickets
Returns how many Tickets the current user has
Declaration
public int Tickets { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
GetCharacter(Season)
Download character for a specific season
Declaration
public void GetCharacter(Season season)
Parameters
Type | Name | Description |
---|---|---|
Season | season |
GetLoginReward()
Declaration
public void GetLoginReward()
LinkAccount(Linktypes, String, Boolean)
Link a player to a specific social media. Use token for Facebook AuthToken, Google's ServerAuthCode or GameCenterId.
Declaration
public void LinkAccount(Linktypes linkType, string token, bool forceLink = false)
Parameters
Type | Name | Description |
---|---|---|
Linktypes | linkType | Which link type to perform. (e.g. Facebook, Google, GameCenter) |
System.String | token | Token or Id acquired from provider |
System.Boolean | forceLink | Force link the social media account to this playfab account, Warning: this will unlink from a previous playfab account. |
Login()
Login a player using last known Authentication type (e.g. silent, facebook, google etc..) Note: if no AuthType is specified then the LoginPrompt Event fires, if no subscription occurs on that event the default will silently authenticate the user via DeviceIDs for the corresponding OS.
Declaration
public void Login()
Login(Authtypes)
Login a player using a specific Authentication type, using this will force Authetication using this type and remember it for future use.
Declaration
public void Login(Authtypes authType)
Parameters
Type | Name | Description |
---|---|---|
Authtypes | authType |
Logout()
Declaration
public void Logout()
Refresh(String)
Refresh Player Data for a particular user
Declaration
public void Refresh(string id = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | if Requesting data for a specific ID other than our Own. |
RefreshCurrencies()
Declaration
public void RefreshCurrencies()
RefreshInventory()
Declaration
public void RefreshInventory()
UnlinkAccount(Linktypes)
Unlink from a specific Social Media Provider
Declaration
public void UnlinkAccount(Linktypes linkType)
Parameters
Type | Name | Description |
---|---|---|
Linktypes | linkType | Which link type to unlink from. (e.g. Facebook, Google, GameCenter) |