Skip to content

ZazuLabs.Arcana.Editor.Data

DataImport

Imports and exports spreadsheet tables. Plan first (Plan), then Apply: rows with errors are skipped, other rows are written. Orphans are only removed by RemoveOrphans.

Member Description
Apply(ImportPlan) Writes every valid row of the plan. Returns the number of assets or entries written.
Export(DataTableImporter, List<string>) Writes the importer's target as a CSV table, to seed a spreadsheet from existing assets. notExported lists what tables cannot hold (executions, custom magnitudes...).
ImportAll(bool) Imports every importer of the project in dependency order. Returns false if any had errors.
ImportAllFromCommandLine() Imports every DataTableImporter of the project: tags, then attributes, then effects. For CI and build scripts: Unity -batchmode -quit -projectPath . -executeMethod ZazuLabs.Arcana.Editor.Data.DataImport.ImportAllFromCommandLine. Never removes orphans. Exits with code 1 if any table has errors.
LoadSource(DataTableImporter, string) Text of the importer's CSV file or link. On failure, returns null and sets error.
Plan(DataTableImporter) Reads the importer's source (file or link) and plans the import.
Plan(DataTableImporter, string, DataValidation) Plans the import of csvText. validation checks tag and attribute names of effect tables; null uses the names of Project Settings → Arcana.
RemoveOrphans(ImportPlan) Removes the plan's orphans from the project. Returns how many were removed.

DataTableImporter

Imports one spreadsheet table (a CSV file or a Google Sheets link) into project assets. Editor-only: tables are a source of assets, never read at runtime.

Member Description
SetEffectsFolder(string) Sets the effects folder from a project path such as Assets/Data/Effects.
AttributeDatabase Target of an attribute table.
CsvFile CSV file, used when Url is empty.
EffectsFolderPath Project path of the effects folder, or null if none or not a folder.
Kind Kind of table.
TagDatabase Target of a tag table.
Url Google Sheets or CSV link.

DataTableKind

Kind of table an importer reads.

Member Description
Attributes Attributes, into an AttributeDatabase.
Effects Gameplay effects, as GameplayEffectAsset files in a folder.
Tags Gameplay tags, into a GameplayTagDatabase.

ImportChange

One asset or entry the import would create or change.

Member Description
ToString()
ChangedColumns Columns whose value changes. Empty for a creation.
IsNew True for a creation.
Name Id, attribute name or tag.

ImportPlan

What an import would do, computed without writing anything: creations, updates, unchanged rows, orphans (in the project, not in the table) and errors.

Member Description
Changes Creations and updates.
Errors Errors (rows skipped) and warnings.
FatalError Fatal problem (missing target, download failure). Nothing can be imported.
HasErrors True if any error, fatal or per row.
Importer Importer the plan was made for.
Orphans Entries in the project that the table does not list. Never removed without confirmation.
Summary One-line summary.
Unchanged Rows identical to the project.