This is A Discord SDK for Unity
UDiscord
to Access The CodeUsing UDiscord
to Access All The FuctionsDiscord Manager
into The Scene , Assign AppID
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");
}
}
}
This is The Manager that handle all the Work to Connect with discord
This Boolan to make the Template Work on Start here is the code Code for it OnConnect.AddListener(CallDiscord); OnConnect?.Invoke();