コード例 #1
0
    //process the user data
    private void LoadedUser(string jsonData)
    {
        Log("Processing user data: " + userID);

        //If we cant find any user data we need to create it
        if (jsonData == null || jsonData == "")
        {
            Log("No user data found, creating new user data");

            user            = new UserInfo();
            user.activeGame = "";
            StartCoroutine(fbManager.SaveData("users/" + userID, JsonUtility.ToJson(user)));
        }
        else
        {
            //We found user data
            user = JsonUtility.FromJson <UserInfo>(jsonData);
        }

        //We now have a user, lets check if our user have an active game.
        CheckedActiveGame();
    }