示例#1
0
    private static async void SessionListener(Session session)
    {
        if (session == null)
        {
            ChangeScene("Login");
        }
        else
        {
            try
            {
                var response = await ApiWrapper.GameCurrent();

                Game.Join(response);
            }
            catch (BadResponseException)
            {
                Game.Current.OnNext(null);
            }
            catch (Exception e)
            {
                Debug.Log(e); // TODO: Show error to player
            }
        }
    }