メインコンテンツまでスキップ

すべてを統合する - Steam でログインする - (Unity モジュール)

Last updated on October 23, 2024

Connect the UI to let player log in with Steam

In this tutorial, you will connect Steam login functionality from the SinglePlatformAuthWrapper_Starter wrapper to the button that resides in the LoginMenuCanvas prefab.

  1. Open SinglePlatformAuthWrapper_Starter. You can connect the Steam login button to the login function. Since you rely on an existing menu canvas in LoginHandler to set the loading state and the retry button callback, you will set them first before getting the Steam authentication session ticket. Copy the highlighted code below into SinglePlatformAuthWrapper_Starter.

    private void OnLoginWithSteamButtonClicked()
    {
    if (loginHandler == null) return;
    loginHandler.OnRetryLoginClicked = OnLoginWithSteamButtonClicked;
    loginHandler.SetView(LoginHandler.LoginView.LoginLoading);
    //get steam token to be used as platform token later
    steamHelper.GetAuthSessionTicket(OnGetAuthSessionTicketFinished);
    }

Resources