Skip to main content
Entity files enable you to read and write files attached to an entity, in any format. The following example demonstrates a full entity-file loop, from signing in, to loading a file, and uploading a new file.

Deconstructing this example

  • GlobalFileLock is a simplistic way to avoid file collisions, specifically designed for this example.
    • Independent file actions won’t cause any issues.
    • Each file action requires many steps and multiple API calls, so don’t try to access the same file in multiple ways at the same time.
    • If you’re careful, you don’t need any locking mechanism.
    • If you want to do something complicated, your locking mechanism might be much more complex.
  • OnGUI is an old, but very dense way, to build a Unity GUI entirely within script.
    • Your GUI will be much better, and game-specific.
  • All PlayFab features first require a login or authentication.
  • LoadAllFiles() does exactly as it says. For the current signed-in entity, it loads all files saved to PlayFab.
    • This function requires multiple steps:
      • Asking PlayFab where the files are located,
      • And then downloading them separately.
  • UploadFile(string fileName) saves the file to the service for the entity.
    • For simplicity, this example saves one file at a time, but you can upload files atomically in sets as well.
    • The steps for this operation are:
      • Initialize an atomic upload operation,
      • Upload all files,
      • Finalize an atomic upload operation.
    • The entity doesn’t consider the file upload complete, nor reflect any changes to other callers until the atomic upload operation is finalized successfully.

Game Manager and entities

The Game Manager allows you to manipulate objects and files for players. The player overview has been updated to show both the title player and master player account information. Also, the Players tab now includes separate sections for files and objects. Entity objects and files are used across several PlayFab features, each scoped to a different entity type:
Last modified on August 10, 2026