Hello, me and my college are working on a Facepunch transport for one of networking solutions for Unity. Lately we had a discussion about the way we should structure our code. It’s public, so UX is our essential priority, therefore we’d like to hear other opinions.
There are three classes we have:
- FacepunchTransportProvider - description of ScriptableObject that stores configuration for the transport and has a method to create it based on that config.
- FacepunchConnection - Internal connection class that stores information about connected client
- FacepunchTransport - Transport itself, that implements few interfaces and does everything important.
So there are two options:
- Combine all three classes in one file. Since it’s going to store definition for a ScriptableObject, it must go by the name FacepunchTransportProvider
- Store every class in a separated file, following class-per-file convention.
Thanks.