If these events are only for your benefit as a developer in order to measure the success of your game, then you could log the player answers as custom analytic events. Unity Analytics is a service provided by Unity Technologies. Your game can send event notifications with small amounts of data to Unity's servers. You can then log into the Unity website and get some statistics about them.
But if you would like to store historical data on the user device in order to allow the player to view their emotional history, this approach won't work. Games can post events to Unity Analytics, but they can't retrieve a history of events they posted before. The most platform-independent way of storing persistent data on the user device is using the PlayerPrefs
class. But it isn't really designed to save large amounts of serial data. A better approach might be to use the standard C# classes for file input and file output (StreamWriter
and StreamReader
) to write and read files on the user device, but this is something which requires testing on each platform you want to support. And it won't work on platforms without a writeable filesystem, like WebGL.
If you need both - local access by the player and server-sided access for analytics - then you won't get around hosting your own server with an own database which offers an API for posting and retrieving data. Unity can post and retrieve data to/from servers using the the HTTP protocol with the class UnityWebRequest
. There is a very, very wide array of possible technologies which can be used to implement such a webservice endpoint on the server side. Explaining all your options would be far out of scope for a single answer.
However, do keep in mind that you are dealing with data which is very personal. It could even be classified as (mental) health data. Data like that is often subject to legal restrictions. So inform yourself which data protection regulations apply to you if you store such data.