Hi there. When the player starts a game he should authenticate and after that a simple request to a server should be made via JSON. (the authentification should be local for now)
I am not sure where to put this request and how a simple JSON Server Request could look like.
Basically i want to retrieve an information which then changes some Materials in the scene.
JSON is just a data serialization mechanism… work through some tutorials for the basic concept of turning objects into strings (serialization) and the reverse (deserialization).
Problems with Unity “tiny lite” built-in JSON:
In general I highly suggest staying away from Unity’s JSON “tiny lite” package. It’s really not very capable at all and will silently fail on very common data structures, such as Dictionaries and Hashes and ALL properties.
Instead grab Newtonsoft JSON .NET off the asset store for free, or else install it from the Unity Package Manager (Window → Package Manager).
PS: for folks howling about how NewtonSoft JSON .NET will “add too much size” to your game, JSON .NET is like 307k in size, and it has the important advantage that it actually works the way you expect a JSON serializer to work in the year 2021.
Depending on your server setup & code. Use UnityWebRequest.Post to send data to your server. An example is in the documentation.
For deserializing json, use newtonsoft json. Either from the asset store (some are quite outdated) or by using the package manager add by package name and fill in com.unity.nuget.newtonsoft-json