Documentation
GameAudio In-Game Voice Chat
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • In-Game Voice Chat
  • SDK Integration
  • Unity3D

SDK Integration Guidelines

Last updated:2022-03-22 13:06

1 Prepare The Environment

  • Windows:

    • Unity 2018.4.8 or above.
    • Visual Studio 2015 or above.
    • Windows 7 or above and Windows devices that support audio and video.
    • The Unity development kit of Unity 2018.4.8 or above has been installed.
    • Ensure that the network connection of the running device is normal.
  • MacOS:

    • macOS 10.0 or above and macOS device that supports audio and video.
    • The Unity development kit of Unity 2018.4.8 or above has been installed.
    • Ensure that the network connection of the running device is normal.
  • Android:

    • Android device or emulator with Android version not lower than 4.1 and support audio and video (recommended to use a real device), if it is a real device, please enable the "Allow debugging" option.
    • Ensure that the network connection of the running device is normal.
  • iOS:

    • Xcode 5.0 or above, iOS 7.0 or above and an iOS device or simulator that supports audio and video (recommended to use a real device).
    • Ensure that the network connection of the running device is normal.

2 Prerequisites

  • Please go to Console Management Console to register an account and apply for the AppID and AppSign required to initialize the SDK. Please refer to ZEGO Admin Console User Manual for the application process.
  • Please download the SDK from ZegoExpressSDK Unity3d. If you want to realize the function of playing local audio and video files (which can be used to play background music, MV, live sound effects, etc.), please download the SDK that includes the MediaPlayer function. For details, please refer to Media Player-Windows and Media Player-MacOS.

3 Integrated SDK

If there is no ready-made project, you can build it according to the unity official website guidelines. For details, please refer to unity official website.

If there is an existing project, follow the steps below. The integration operation of the Windows/MacOS/Android/iOS platform is similar.

3.1 New project example

Note: This step takes how to create a new project as an example. If it is integrated into an existing project, you can ignore this step.

  1. Open Unity, enter the project name and location, and click "Create".

After creating the project, enter the following interface:

/Pics/Unity3D/ZegoExpressEngine/unity3d-create-proj/newProj.png

3.2 Import SDK

  1. Unzip the downloaded SDK.

  2. Copy the two directories of Plugins and Scripts of the SDK to the Assets directory.

  1. Copy the ZegoQuickStart.cs and ConsoleLogOutput.cs files in the demo to the directory.
  1. Drag the script to the Inspector on the right column.

    /Pics/Unity3D/ZegoExpressEngine/unity3d-create-proj/addScripts.png

3.3 Add SDK reference

Change the AppID in the ZegoQuickStart.cs file to the AppID obtained in the "Prerequisites" of this article.

// AppID and AppSign are assigned to each App by ZEGO.
// For security reasons, it is recommended to store AppSign in the business background of the App and obtain it from the background when using it.
zego_client_.InitSdk(appid, new byte[] {/* fill in the app sign here, the format is: 0x1e, 0xc3, 0xf8*/} }, user_id_, user_name);
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code