Sheets is a C# class designed to facilitate the reading and processing of CSV data within the Unity game engine. This utility is particularly useful for handling spreadsheet data exported to CSV format.


Release v1.0.0

https://github.com/swzwij/Code-Crate/releases/tag/Sheets-v1.0.0


Installation

Importing a Unity Package:

  1. Download the Package: Locate the Unity package you want to import. This could be from the Unity Asset Store or a developer's website. Download the .unitypackage file.

  2. Import into Unity: There are two ways to import the package into your Unity project:

  3. Import Options (Optional):

    A window will appear showing the contents of the package. By default, all items are selected for import. You can uncheck any files or folders you don't want to import into your project.

  4. Click Import: Once you're happy with the selection, click Import to begin importing the package files into your project.


Usage

Function Description
Read Reads a CSV file from the Unity Resources folder and returns the data from the CSV file as a list of dictionaries, where each dictionary represents a row of data with column headers as keys.
GetValue Retrieves the value at a specified row index and under a given header in a CSV file and returns the value if found; otherwise, logs an error and returns null.
GetRowValues Retrieves the values of a specific row from a CSV file parsed into an array and returns an array containing the values of the specified row, or an empty array if the index is out of bounds.
GetCollumValues Retrieves the values of a specific column (header) from a CSV file parsed into a collection of dictionaries and returns an array containing the values of the specified column, or an array of null values if the header is not found.