AgoraIO / signaling-sdk-samples-unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity reference app for Agora Signaling SDK

This repository holds the code examples used for the Agora Signaling SDK for Unity documentation. It is a robust and comprehensive documentation reference app for Unity, designed to enhance your productivity and understanding. It's built to be flexible, easily extensible, and beginner-friendly.

Clone the repo, run, and test the samples, and use the code in your own project. Enjoy.

Samples

This reference app includes several samples that illustrate the functionality and features of Agora Signaling SDK. Each sample is self-contained and the relevant code can be found in its own folder in the root directory. For more information about each sample, see:

To view the UI implementation, see SignalingUI.

Prerequisites

Before getting started with this reference app, ensure you have the following set up:

Run the app

  1. Clone the repository

    To clone the repository to your local machine, open Terminal and navigate to the directory where you want to clone the repository. Then, use the following command:

    git clone https://github.com/AgoraIO/signaling-sdk-samples-unity.git
  2. Open the project

    1. In Unity Hub, Open signaling-sdk-samples-unity, Unity Editor opens the project.

      Unity Editor warns of compile errors. Don't worry, you fix them when you import Signaling SDK for Unity.

    2. Go Assets\Scenes, and open SampleScene.unity. The sample scene opens.

    3. Unzip the latest version of the Agora Signaling SDK to a local folder.

    4. In Unity, click Assets > Import Package > Custom Package.

    5. Navigate to the Signaling SDK package and click Open.

    6. In Import Unity Package, click Import.

      Unity recompiles the Signaling SDK samples for Unity and the warnings disappear.

  3. Modify the project configuration

    The app loads connection parameters from the config.json file. Ensure that the file is populated with the required parameter values before running the application.

    • uid: The user ID associated with the application.
    • appId: (Required) The unique ID for the application obtained from Agora Console.
    • channelName: The default name of the channel to join.
    • token: A token generated for uid. You generate a temporary token using the Agora token builder.
    • serverUrl: The URL for the token generator. See Secure authentication with tokens for information on how to set up a token server.
    • tokenExpiryTime: The time in seconds after which a token expires.

    If a valid serverUrl is provided, all samples use the token server to obtain a token except the SDK quickstart project that uses the token. If a serverUrl is not specified, all samples except Secure authentication with tokens use the token from config.json.

  4. Build and run the project

    In Unity Editor, click Play. A moment later you see the game running on your development device.

  5. Run the samples in the reference app

    From the main app screen, choose and launch a sample.

Contact

If you have any questions, issues, or suggestions, please file an issue in our GitHub Issue Tracker.

About


Languages

Language:C# 50.8%Language:ShaderLab 41.9%Language:HLSL 7.3%