Back to Table of Contents
Adding Data Fields
When you select a DataSet in the TreeView, you’ll see the following display.
Initially, only the default “id” field appears in the Variables area.
While you can configure several settings in the Basic Information area at the top, we’ll skip these advanced features for now.
Let’s add the following fields to define our Character settings:
Click “Add” multiple times to create 6 new fields (tip: It’s easier to add all fields first and edit their names later)
Set the field names as follows:
Name
Job
Hp
Mp
Atk
Def
Setting Data Types
After adding the fields, specify their data types. For example, “Name” should be a string, while “Hp” could be an int or uint.
Let’s define the types as follows:
id | string |
Name | string |
Job | string または Tables[JOB]※ |
Hp | int |
Mp | int |
Atk | int |
Def | int |
Note: While Job can be defined as a string, using an enum is more convenient if you have a predetermined set of job types in your game. For information on using custom enum types, refer to:
If you don’t need this now, you can set it as string.
The Description field acts as a memo field – useful for clarifying unclear field names but can be left empty.
Important: Remember to save your header information frequently using the “Save Header” button in the Actions area at the bottom of the window.
Once you’ve completed these settings, we’ll move on to creating the ScriptableObject.
コメント