PlayerPrefs
Most PlayerPrefs actions in PlayMaker are thin wrappers around Unity's PlayerPrefs API.
Unity API
Actions that directly wrap Unity PlayerPrefs methods or properties link to the corresponding PlayerPrefs API reference.
Unity API-backed actions
These actions map directly to common Unity PlayerPrefs operations:
- Set/Get Int
- Set/Get Float
- Set/Get String
- Has Key
- Delete Key
- Delete All
- Save
Extended variable save/load actions
PlayMaker also includes two extended actions that go beyond the raw Unity API:
PlayerPrefs Save Variable
Saves an arbitrary PlayMaker variable by serializing it to JSON and storing it with PlayerPrefs.SetString.
| Parameter | Description |
|---|---|
| Key | Unique key used to store the value. |
| Variable | Variable to serialize and save. |
PlayerPrefs Load Variable
Loads JSON from PlayerPrefs and deserializes it back into a PlayMaker variable type.
| Parameter | Description |
|---|---|
| Key | Unique key used to load the value. |
| Variable | Variable target to deserialize into. Should match the saved type. |
Notes
- These variable actions are useful when you want one generic save/load path for many variable types.
- Scene object references cannot be saved in PlayerPrefs.