discord / discord-rpc

https://discordapp.com/developers
MIT License
1.06k stars 327 forks source link

RPC on unity #139

Closed Issvn closed 6 years ago

Issvn commented 6 years ago

Hi ! I wanna know how to include Rich Presence inside a Unity3D game. Thanks for your answers.

msciotti commented 6 years ago

Hi Issvn,

To integrate Rich Presence into a Unity game, you'll need to first:

  1. Get the right DLL for your game by following the README in this repo
  2. Check out the documentation to see how the SDK works

Once you're familiar with the SDK and what's in it, for Unity specifically:

  1. Copy the DLLs to Assets/Plugins/ folder in your project. On windows, you'll wanna add the 32bit dll to /x86_64 and the 64bit to /x86_64/. On other operating systems, I believe you just stick it in Assets/Plugins/

  2. Take a look at the Unity example (examples/button-clicker) in this repo. There, you'll find DiscordRpc.cs which you can use as a header file to talk to the SDK.

  3. Work from that example. You can reference DiscordController.cs for a basic example that includes presence updates, joining, and ask to join.