eslam980 / Ultimate-Discord-SDK

This is A Discord SDK for Unity
13 stars 1 forks source link
csharp unity

Ultimate Discord SDK

This is A Discord SDK for Unity image

Features

Discord-Levlinvite.png

Usage

How To Get Started

Examples

using UnityEngine; using UDiscord; // Use This To Get Discord Manager

public class ExampleButton : MonoBehaviour { public void OnClick() { // Calling DiscordManager.App.UpdateRich : To Update Dicsord Rich But Will Change detail , state Only // Only Things That you put it in UpdateRich , Will Change , Others will stay the Same.

    DiscordManager.App.UpdateRich(detail : "Playing Solo" , state : "Private Lobby");
}

}

[![Discord-Image.png](https://i.postimg.cc/0j1H1WMt/Discord-Image.png)](https://postimg.cc/bDLRQRRb)

- Other Example Is A **OnTriggerEnter()**  To Change Rich will entering Another Area
- Code Example :
```csharp

using UnityEngine;
using UDiscord; // Use This To Get Discord Manager

public class ExampleTrigger : MonoBehaviour
{
    void OnTriggerEnter(Collider other)
    {
        //When AnyThing enter Area
        DiscordManager.App.UpdateRich(detail : "Playing Solo" , state : "Desert");

        //other Way
        if(other.gameObject.CompareTag("Player"))
        {
            DiscordManager.App.UpdateRich(detail : "Playing Solo" , state : "Sky");
        }
    }
}

Discord Manager

This is The Manager that handle all the Work to Connect with discord

Discord_Start

This Boolan to make the Template Work on Start here is the code Code for it OnConnect.AddListener(CallDiscord); OnConnect?.Invoke();