Skip to content
SheetForge

Getting started

Import a sheet into Unity and load it in your game. This page takes a new project to its first loaded database.

A sheet is one table of your data. SheetForge also calls it a tab.

Before you begin

  • Unity 2022.3 or newer. SheetForge is developed and tested on Unity 6 (6000.0.79f1) with the URP template.
  • A sheet in the SheetForge layout. A folder of .tsv, .csv or .xlsx files, or a Google sheet. Each sheet has a marker column in front and three marker rows on top. Sheet layout shows an example.

If you have no sheet yet, take the shortest path first. Try a demo, or create a sheet from a template in the Getting Started window. A template needs a settings asset, so create one first (the next step, with an empty folder) and then come back to the template.

Note

Baked databases reach your game through a delivery mode. The default mode, Addressables, needs the com.unity.addressables package. The other two modes need no package. To compare them, see Choose a delivery mode.

Import your first sheet

  1. Import the asset

    Import SheetForge from the Asset Store. The "Package Manager dependencies" prompt appears before compilation.

    • To use the Addressables mode, choose Install. Addressables is installed alongside.
    • If you plan to deliver through a Resources folder or a scene catalogue, choose Skip.
  2. Create a settings asset

    In the Getting Started window, press New settings asset. The Add workbook form opens inside the window. Name the workbook, keep Local files (TSV · CSV · xlsx) as its source, pick the folder that holds your sheet files, and press Create. The form creates the settings asset, makes it active, and starts its first import when the folder already holds sheets.

    You can also right-click in the Project window and choose Create ▸ SheetForge ▸ Import Settings. Then select the new asset. In the Inspector, set Source Mode to Local files (TSV · CSV · xlsx), and set Local Folder Path to the folder that holds your sheet files. SheetForge scans only the immediate children of that folder.

    If you chose Skip when you imported the asset, pick the delivery mode now. Select the new settings asset and set Asset delivery to Resources folder or Scene catalogue (no Addressables, no Resources). A new settings asset starts in the Addressables mode. If the form already started the first import, that import stopped at the Addressables install notice, so run it again in the next step.

    To read a Google sheet instead, follow Google Sheets setup first.

    With a single settings asset in the project, the first import selects it. You do not need to choose one.

    Tip

    If you already have a folder of sheet files, drag it from the Project window onto the Data Studio. SheetForge offers to create the settings asset for you. See Drop a folder or a file.

  3. Run the import

    Open Tools ▸ SheetForge ▸ Data Studio, then press ↓ Import in the toolbar. If the Add workbook form already ran the first import, skip this step.

    The pipeline fetches the sheets, validates them, generates code, and bakes the databases. The Console prints the diagnostics as a report in your language. When the import is done, the Getting Started window shows ✓ in its First import completed row.

    Validation collects every diagnostic in one run. It never stops at the first error. If the sheets hold even one error, the import produces no output. There is no partial assembly.

    If your game code stops compiling during the import, the import stops at once and the Console says what to do. It does not retry. See Import recompiles before it finishes.

    Why the first import reloads the editor

    The first import completes in two internal stages. When a schema is new or changed, the import writes generated code. That triggers a compile and a domain reload. After the reload, the import resumes the bake by itself. You press the button once and re-trigger nothing. The automatic import chain has the details.

  4. Load the data

    Call the loader from your game code. A tab named Items generates the class ItemsDatabase, by default in the SheetForge.Generated namespace. The tab name is the key you load by. With local files, a tab takes its name from the file. See Local files.

    using SheetForge.Generated;
    using SheetForge.Runtime;
    using UnityEngine;
     
    SheetForgeLoadHandle<ItemsDatabase> handle = SheetForgeDatabases.LoadAsync<ItemsDatabase>("Items");
    ItemsDatabase db = await handle;          // or handle.Completed += h => …, or poll handle.IsDone
    if (handle.Status == SheetForgeLoadStatus.Succeeded)
    {
        // use db
    }
    else
    {
        Debug.LogWarning(handle.Error);       // plain words: what was asked for and why it could not be served
    }
    SheetForgeDatabases.Release(handle);      // once per load; a no-op in modes that hold nothing

    The same call works in every delivery mode. In the scene catalogue mode, a scene must carry the catalogue before the first load. See Scene catalogue.

    The SheetForge.Runtime assembly is autoReferenced. Game code can use it without an asmdef reference.

How loading works

The import publishes each tab's database under the key "SheetForge/{tab}", in the way the delivery mode requires. Your game loads by that key in every mode. Address loading explains why.

ModeWhere the database goes
AddressablesRegistered at that address in the SheetForge group
Resources folderWritten to {Resources folder}/SheetForge/{tab}.asset, so the key is the resource path
Scene catalogueWritten beside a SheetForgeCatalog.asset that references every database

Game code never branches on the mode. The generated code carries a small {Settings}_{guid8}DeliveryRegistration class for each workbook, which is one settings asset and the source it names. The class registers that workbook's tabs with the chosen mode before the first scene loads.

Two workbooks in one project may deliver differently. The runtime routes each load by its tab name.

Other ways to call the loader

CallResult
LoadAsync("Items") with no type argumentReturns SheetForgeLoadHandle<DefinitionDatabase>
handle.WaitForCompletion()Blocks and returns the result where the loader can finish synchronously

WaitForCompletion() always finishes in the Resources and scene catalogue modes. In the Addressables mode it finishes when the content is reachable synchronously. Where it cannot finish, it fails the handle with a message.

In this chapter

Next steps