Automatically converts Excel files (.xls, .xlsx) into Unity ScriptableObject assets.
This Project is based on unity-excel-importer and includes some fatures that not available in the original project.
- Zero-code Generation: No need to manually write entity class scripts, automatically generate complete code
- Real-time Sync: Excel modifications automatically update Unity assets
- Smart Comments: Support for comment rows/columns and data boundaries
- Rich Types: Support basic types, enums, arrays, dictionaries, datetime and custom types
- Multi-sheet Support: Import all worksheets in an Excel file at once
- Simple Functionality: No configuration required, ready for use upon direct import
- Unity Version: 2021.3.45f1 or later
- Excel File Formats: .xls, .xlsx
💡 Install via .unitypackage file (Recommended)
- Visit GitHub Releases page
- Download the latest
.unitypackagefile - Double-click the file or import via Assets → Import Package → Custom Package in Unity
💡 Install via OpenUPM
This package is available on the OpenUPM repository. Please ensure your project has the `NPOI` and `Newtonsoft.Json` dependencies installed before installing.openupm add net.nayaku.unity-excel-importer-x
💡 Install as GIT dependency via Package Manager
Please ensure your project has the NPOI and Newtonsoft.Json dependencies installed before installing.
- Open Package Manager window (Window | Package Manager)
- Click
+button on the upper-left of a window, and select "Add package from git URL..." - Enter the following URL and click
Addbutton
https://github.com/nayaku/UnityExcelImporterX.git?path=Assets/UnityExcelImporterX
Create an Excel file with the following structure:
| Row | Content | Example |
|---|---|---|
| Row 1 | Column names (field names) | id, name, price |
| Row 2 | C# data types | int, string, float |
| Row 3 | Comments/Descriptions | ID, Item Name, Price |
| Row 4+ | Actual data | 1, item1, 99.5 |
Place the Excel file anywhere in your Unity project
- Select the Excel file in Unity
- Right-click → Create → ExcelAssetScript (or use Assets → Create → ExcelAssetScript from top menu)
- System will automatically generate entity class scripts (e.g.,
MstItems.cs)
Generated Code Example:
// Entity class - corresponds to each row of the table
[Serializable]
public class MstItemsEntity
{
/// <summary>
/// ID
/// </summary>
public int id; // Auto-matches Excel column 1
/// <summary>
/// Item Name
/// </summary>
public string name; // Auto-matches Excel column 2
/// <summary>
/// Price
/// </summary>
public float price; // Auto-matches Excel column 3
}
// Container class - stores all table data
[ExcelAsset]
public class MstItems : ScriptableObject
{
public List<MstItemsEntity> Entities; // All row data
}Warning
Important: When the Excel table structure changes (e.g., adding/removing columns), repeat this step to generate the latest code.
- Save the Excel file (Ctrl+S)
- Return to Unity, the system will automatically detect changes and import data
- A
.assetfile with the same name as the Excel file will be generated in the same directory
If not automatically generated, you can manually reimport the Excel file to trigger auto-generation:

Now you can view and edit imported data directly in Unity:
Enter # in the first cell of a row to skip the entire row.
Enter # in the first cell of a column to skip the entire column.
Generated Code and Data:
[Serializable]
public class SummaryExampleEntity
{
public int id; // Only imports columns A, B, column C is ignored
/// <summary>
/// name of item
/// </summary>
public string name;
}
[ExcelAsset]
public class SummaryExample : ScriptableObject
{
public List<SummaryExampleEntity> item;
}- Column Boundary: When an empty cell appears in row 1, all columns to the right will be ignored
- Row Boundary: When an empty cell appears in column 1, all rows below will be ignored
// Create ColorEnum.cs file
public enum ColorEnum
{
RED,
GREEN,
BLUE
}[Serializable]
public class EnumExampleEntity
{
public int id;
/// <summary>
/// Name
/// </summary>
public string name;
/// <summary>
/// Color
/// </summary>
public ColorEnum color; // Auto-matches enum type
}Supports array types, datetime types, dictionary types and custom types
When using array types, square brackets can be omitted.
Generated Code and Data:
Create custom type CustomType
[Serializable]
public class CustomType
{
public int x;
public string s;
}You can change the ScriptableObject generation position by specifying AssetPath as the ExcelAssetAttribute as shown below:
[ExcelAsset(AssetPath = "Assets/Resources/MasterData")]
public class MstItems : ScriptableObject
{
public List<MstItemsEntity> Entities;
}When true is specified for LogOnImport of ExcelAssetAttribute, a log is output when the import process runs.
[ExcelAsset(LogOnImport = true)] // Output detailed logs during import
public class MstItems : ScriptableObject
{
public List<MstItemsEntity> Entities;
}You can change the association to a specific Excel file by specifying ExcelName of ExcelAssetAttribute:
// Excel file name is "ItemData.xlsx"
// ScriptableObject class name is "MstItems"
[ExcelAsset(ExcelName = "ItemData")] // Specify associated Excel file name
public class MstItems : ScriptableObject
{
public List<MstItemsEntity> Entities;
}Q: Excel changes not auto-updating?
Solutions:
- Ensure Excel file is saved
- Right-click Excel file in Unity → Reimport
- Check console for error messages
This library is under the MIT License.
If this tool helps you, please give it a ⭐Star!







