Skip to content

Installation

Steps for Integrating Cobra Packets

To integrate Cobra Packets into your Unity project, follow these steps:

  1. Download and Import Cobra Logging: This package depends on Cobra Logging. Download the Cobra Logging (link) package and import it into your Unity project.
  2. Download Cobra Packets: Obtain the Cobra Packets package and import it into your Unity project.
  3. 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.
  4. Locate Cobra Packets Folder: Navigate to Assets/Byte Cobra/Cobra Packets in your Unity project's assets. Here, locate the Packages sub-folder.
  5. 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 and Network prefabs in your scene.
  • Assign Dependencies: Assign the Network in the Server Manager inspector window.

For Fish-Net

  • Add Prefabs: Add the Server Manager and Fish Manager prefabs to your scene.
  • Assign Dependencies: Assign the Fish Manager in the Server 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 and Network prefabs into your scene.
  • Assign Dependencies: Assign the Network in the Client Manager inspector window.

For Fish-Net

  • Add Prefabs: Place the Client Manager and Fish Client prefabs in your scene.
  • Assign Dependencies: Assign the Fish Client in the Client Manager inspector window.