Create a New Scene: Open Unity and create a new scene.
Add Prefabs: Navigate to the Prefabs folder, and drag the Server and Client prefabs into your scene. Both prefabs come pre-configured with NetworkManager and Transport components to facilitate a quicker network setup.
Configuration
Set Network Settings: On both the Server and Client objects, configure the host and port settings to be identical. Select the appropriate Transport type e.g. TCP or UDP based on your project's needs.
Create Custom Events: Develop your own network events by subclassing NetworkEvent and implementing the Serialize and Deserialize methods to manage data. Look at the example scripts for help.
Register Events: Create a custom EventInitializer to include your specific events. Assign your custom EventInitializer to both the server and client objects. For guidance on implementation, refer to the example scenes provided.
Create Custom Requests: Create network requests by subclassing NetworkRequest and implementing Serialize and Deserialize for both the request and its response. Look at the example scripts for help.
Register Requests: Extend RequestInitializer with your custom requests. Look at the examples for help. Assign your custom RequestInitializer to both the server and client objects.
Optional Authentication: For simple username/password authentication, use BasicClientAuthenticatorBehaviour and BasicServerAuthenticatorBehaviour. For more advanced or custom authentication methods, extend ClientAuthenticatorBehaviour and ServerAuthenticatorBehaviour with your own classes and implement the methods.
Implement Event and Request Scripts: Write scripts to handle the custom events and requests you've created, adjusting these scripts based on what your game or application needs.