Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/track/dissonity.git?path=hirpc-interface

README

[!NOTE] Looking for version 1? See the v1 branch.

About

Dissonity is a Unity SDK that allows you to easily make Discord activities!

It is a C# implementation of the Embedded App SDK.

Example

using UnityEngine;
using Dissonity.Models;
using Dissonity.Models.Builders;
using static Dissonity.Api;

public class MyScript : MonoBehaviour
{
    async void Start()
    {
        // Initialize Dissonity
        await Initialize();

        // Update activity
        await Commands.SetActivity(new ActivityBuilder
        {
            Type = ActivityType.Playing,
            Details = "Selecting game mode",
            State = "In a Group"
        });

        // Get all the participants in the activity
        Participant[] participants = await Commands.GetInstanceConnectedParticipants();

        foreach (Participant participant in participants)
        {
            Debug.Log($"{participant.DisplayName} is playing!");
        }

        // Subscribe to speaking start
        await Subscribe.SpeakingStart(ChannelId, (data) =>
        {
            Debug.Log($"User with id {data.UserId} is speaking!");
        });
    }
}

Installation

You can also install Dissonity via OpenUPM or with each .unitypackage file found in the Releases tab.

  1. Create a new Unity project (Unity 2021.3 or later, Unity 6 recommended)
  2. Open the package manager and install the package from this git URL: https://github.com/Furnyr/Dissonity.git?path=/unity#v2
  3. Use the pop-up dialog to select a configuration file
  4. Set the build platform to Web / WebGL
  5. Player settings > Resolution and Presentation > Set the WebGL template to Dissonity

Dissonity is now installed! But you still need to configure a few things:

Configuration

  1. Open the configuration file in Assets/Dissonity/DissonityConfiguration.cs
  2. Set your app id in <SdkConfiguration>.ClientId (find it or create a Discord app here)

Up and running! If you want to test your activity within Unity:

Testing

  1. Right-click the hierarchy > Dissonity > Discord Mock

If you run the game in a scene where there's a @DiscordMock object, you will be able to test the activity within Unity, simulating Discord.

If there isn't a mock object in the scene, Dissonity will automatically create one.

Production

Dissonity helps in the process to make the game, but you will still need to host the backend that will serve the activity to Discord and handle authentication.

If you're not sure how to continue, read the documentation.

[!TIP] If you are also using a framework that provides Discord functionality, you should read Third-party support.

Documentation

Contact

License

Licensed under the Apache License, Version 2.0.

This project includes code from the Discord Embedded App SDK, licensed under the MIT License.

Disclaimer

This project is not affiliated, endorsed, or sponsored by Discord Inc. or Unity Technologies.

The Discord Developer Terms of Service, Discord Developer Policy and Unity Terms of Service apply to you and the applications you develop utilizing this SDK.

Total Installs
0
Last 30 days
Unique IPs
0
Approximate users

Installs Over Time

Operating Systems

No data yet

Top Countries

No data yet

Git Versions

No data yet

Embed Install Badge

Add an install count badge to your README

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/dissonity.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/dissonity)
HTML
<a href="https://www.pkglnk.dev/pkg/dissonity"><img src="https://www.pkglnk.dev/badge/dissonity.svg?style=pkglnk" alt="pkglnk installs"></a>

Comments

No comments yet. Be the first!