ScriptableObject
ZepetoScriptableObject supports Unity ScriptableObject. ZepetoScriptableObject is a data container that saves large amounts of data, such as world data settings and character options.
To create a new ZepetoScriptableObject file, click the [+] icon in the top left corner of the Project panel, or click Assets → Create → ZEPETO → ScriptableObject.
The newly created ZepetoScriptableObject needs to be connected by creating scripts with a defined data class.
Make a new ZEPETOScript file, and declare the data you will use as the member variables.
Here are some sample codes that can be used as data.
When you link the ZEPETOScript with the defined data class to ZepetoScriptableObjects, you will see those data in the Inspector window, as shown below.
Create a ZEPETOScript file to call data from the ZepetoScriptableObject.
Import the ZepetoScriptableObject from the ZEPETOScript and import the data type you have declared as well.
Declare the ZepetoScriptableObject’s as properties in the ZEPETOScript.
Open the Inspector window in ZEPETOScript assign values for the ZepetoScriptableObject properties, as shown below.
This sample shows how you can use the ZepetoScriptableObject and access it’s values.
To access a primitive type of member variable, declare it as a generic type or covert it using type casting, like the example shown below.
Check the full code example for ScriptableObject.