Installation
Steps for Integrating Cobra Packets
To integrate Cobra Packets into your Unity project, follow these steps:
- Download and Import Cobra Logging: This package depends on Cobra Logging. Download the Cobra Logging (link) package and import it into your Unity project.
- Download Cobra Packets: Obtain the Cobra Packets package and import it into your Unity project.
- Network Library Integration: Select and import a network library supported by Cobra Packets, such as Mirror or Fish-Net, based on your project's needs.
- Locate Cobra Packets Folder: Navigate to
Assets/Byte Cobra/Cobra Packets
in your Unity project's assets. Here, locate thePackages
sub-folder. - Import Network Framework Packages: Choose and import the specific Unity package for your selected network framework (either Mirror or Fish-Net) from this folder.
Scene Configuration
Configure your Unity scene to integrate Cobra Packets. The process is generally similar across different frameworks but with some nuances to consider.
Server Scene Configuration
Configure the server components in your scene:
- Access Integrations: Navigate to
Assets/Byte Cobra/Cobra Packets/Integrations
and select your network framework's folder, e.g.,Assets/Byte Cobra/Cobra Packets/Integrations/Mirror
. - Prefabs: Open the prefabs folder.
For Mirror
- Add Prefabs: Include the
Server Manager
andNetwork
prefabs in your scene. - Assign Dependencies: Assign the
Network
in theServer Manager
inspector window.
For Fish-Net
- Add Prefabs: Add the
Server Manager
andFish Manager
prefabs to your scene. - Assign Dependencies: Assign the
Fish Manager
in theServer Manager
inspector window.
Client Scene Configuration
Configure the client components in your scene:
- Access Integrations: Similar to the server setup, go to
Assets/Byte Cobra/Cobra Packets/Integrations
and choose your network framework's folder. - Prefabs: Open the prefabs folder.
For Mirror
- Add Prefabs: Incorporate the
Client Manager
andNetwork
prefabs into your scene. - Assign Dependencies: Assign the
Network
in theClient Manager
inspector window.
For Fish-Net
- Add Prefabs: Place the
Client Manager
andFish Client
prefabs in your scene. - Assign Dependencies: Assign the
Fish Client
in theClient Manager
inspector window.