Quick Start: Import Your First CSV
This guide walks you through importing a basic weapon spreadsheet into Unity ScriptableObjects in under 2 minutes.
Step 1: Create the C# ScriptableObject
Create a new C# script named WeaponData.cs inside your assets folder:
using UnityEngine;
[CreateAssetMenu(fileName = "NewWeapon", menuName = "Data/Weapon")]
public class WeaponData : ScriptableObject
{
public string weaponName;
public int baseDamage;
public float attackRange;
}
Step 2: Prepare the CSV File
Create a text file named Weapons.csv using Notepad, Excel, or Google Sheets with the following content:
id,weaponName,baseDamage,attackRange
sword_copper,Copper Sword,15,1.2
spear_iron,Iron Spear,22,2.5
bow_wood,Wooden Bow,12,6.0
- Note: The first column
idwill be our unique identifier to name the generated asset files.
Step 3: Configure the Control Panel
- Open the dashboard via Tools > DataLoom > Control Panel.
- Drag & Drop your
Weapons.csvfile directly into the 1. Data Input Sources drop area (or click Add File (Browse)). - Under 2. Mapping & Output Settings:
- Set Target ScriptableObject C# Type to
WeaponData. - Set Key Identifier Column Name to
id. - Set Output Save Folder Path to
Assets/Weapons.
- Set Target ScriptableObject C# Type to
- Click Generate ScriptableObjects.
Results
Look at your Project window under Assets/Weapons/. You will find three newly generated ScriptableObject assets:
sword_copper.assetspear_iron.assetbow_wood.asset
Select any asset to inspect its parameters. The damage, range, and display names are populated correctly.
Pro Tip
If you make changes to the spreadsheet values, simply re-run the generator. With Overwrite Existing Assets enabled, DataLoom updates the fields on existing files rather than duplicating them.