Пример #1
0
    /*
     *  Upon successful login, set up the store for our game and find the user's wish list.
     *
     *  @param result: the PlayFab LoginResult object which occurs upon a successful call to LoginWithPlayFab
     *
     *  When the player clicks the button to log in, the Client calls LoginWithPlayFabRequest to return
     *  the login token. Authenticate the client in order to call other PlayFab Client APIs.
     *
     */

    private void OnLoginSuccess(LoginResult result)
    {
        LoginClass.player_entityKeyId   = result.EntityToken.Entity.Id;
        LoginClass.player_entityKeyType = result.EntityToken.Entity.Type;

        PlayFab.GroupsModels.EntityKey entity = new PlayFab.GroupsModels.EntityKey {
            Id = LoginClass.player_entityKeyId, Type = LoginClass.player_entityKeyType
        };

        var request = new ListMembershipRequest {
            Entity = entity
        };

        /* Set up the store buttons for the Unity game. This will change depending on the nature of your game. */

        StoreSetup.StoreStart();

        /* Now that the player has logged in, find their wish list. If not found, create it. */

        WishList.FindOrCreateWishList(LoginClass.player_entityKeyId, LoginClass.player_entityKeyType);
    }