Next: PlayerPrefs Save Game Manager, Previous: Scene Object List Serializer, Up: Serialization [Contents][Index]
Unique Object Serializer allows you to save & load one object field in your game. This is for *unique* fields. So, for example, if you try to save the enemy’s health, then when you load the game *every* enemy with that prefab will load the health of the last one to save with that ’File Name’. But, if you save the Player’s health, that is fine since there is only one local player at a time so there are no duplicates to cause errors. This is great for saving things like user preferences. This component saves to a binary file, and therefore does not work on web builds.
string
targetFieldWhat is the data name of the field. This is the name in program code, which you can usually determine by looking at the Inspector. Unity capitalizes the first letter and adds a space before each capital letter in the Inspector. So a field with name ’Monster Health’ is called ’monsterHealth’ in code and that is how you must write it here. For some script packages, you might need to look at the code by viewing the script in the Inspector first if possible.
Default value: ""
string
fileNameA unique file name for this one, if you have multiple fields you want to save with the same name then you can add a file name to each one to save them separately.
Default value: ""
Saves the ’Target Field’ from ’Target Component’ into ’File Name’
Loads ’Target Field’ from ’File Name’ and reassigns it’s value from disk.
string
targetFieldWhat is the data name of the field. This is the name in program code, which you can usually determine by looking at the Inspector. Unity capitalizes the first letter and adds a space before each capital letter in the Inspector. So a field with name ’Monster Health’ is called ’monsterHealth’ in code and that is how you must write it here. For some script packages, you might need to look at the code by viewing the script in the Inspector first if possible.
Default value: ""
string
fileNameA unique file name for this one, if you have multiple fields you want to save with the same name then you can add a file name to each one to save them separately.
Default value: ""
Saves the ’Target Field’ from ’Target Component’ into ’File Name’
Loads ’Target Field’ from ’File Name’ and reassigns it’s value from disk.
Next: PlayerPrefs Save Game Manager, Previous: Scene Object List Serializer, Up: Serialization [Contents][Index]