Joris Eijmberts

Turning crazy ideas into games!

CP Social settings

CP Social settings class diagram

What?

CP Social settings is a ScriptableObject in the unity project that keeps track of all data (eg. achievement names, sprites, appId’s, etc.) needed by CP Social to operate correctly.

Why?

The reason for using a ScriptableObject in for the CP Social settings is that it would be persistent and easy to edit from the Unity editor, without having to create complex editors to edit the data.

ScriptableObjects get a default editor within Unity to edit the data, so this would be a lot simpler to use than something like JSON and create a custom editor to edit this data. Even though for the settings object I eventually created a custom editor as well.

Default Unity ScriptableObject editor

Alternatives

The CP Settings object didn’t have to be a ScriptableObject, I could have chosen a JSON file to save the same data as in the ScriptableObject but when it came to referencing assets from the project this would be become quite a mess to deal with.

So to keep it simple, I opted for the tried en tested way and used a ScriptableObject to store CP Social’s data.