This section explains how to create your own data slot.
As an example I will explain how to make data until you exchange data through simple player data creation.
Create PlayerData script file
Create a script file.
- Select “Create> C # Script” from the Project window right-click menu.
- This time we will name PlayerData.
Write in PlayerData.cs as follows.
Create PlayerData class
This time we are simply creating a class with maximum HP and current HP.
Creating the OutputSlotPlayerData class
We are creating a class for outputting PlayerData class.
All processing is provided in OutputSlot<T>, so you do not need to write anything in particular.
We are preparing to avoid the Unity specification that the generic class can not be serialized.
Creating the InputSlotPlayerData class
We are creating a class to enter PlayerData class.
Since processing necessary for InputSlot<T> is also prepared here, there is no need to describe contents in particular.
If you want to use it as a parameter of ParameterContainer, it is convenient to generate it from Variable Generator.
See Variable for details.