diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-12-05 13:18:39 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-12-05 13:18:39 -0500 |
| commit | 0f7e3ced25ee1138980f4ddfcb37e45fbc54bead (patch) | |
| tree | 33f34ab33f1af5bb3413372030ef25642eedded1 /Assets/Scripts/DiscordController.cs | |
| parent | df8769c71a03c4fc47945e39eed16d500f82ad71 (diff) | |
| download | Project-Sandbox-0f7e3ced25ee1138980f4ddfcb37e45fbc54bead.tar.gz Project-Sandbox-0f7e3ced25ee1138980f4ddfcb37e45fbc54bead.tar.bz2 Project-Sandbox-0f7e3ced25ee1138980f4ddfcb37e45fbc54bead.zip | |
Discord RPC; Removed jumping function for now
Diffstat (limited to 'Assets/Scripts/DiscordController.cs')
| -rw-r--r-- | Assets/Scripts/DiscordController.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Assets/Scripts/DiscordController.cs b/Assets/Scripts/DiscordController.cs new file mode 100644 index 0000000..db0eec1 --- /dev/null +++ b/Assets/Scripts/DiscordController.cs @@ -0,0 +1,48 @@ +using UnityEngine;
+
+public class DiscordController : MonoBehaviour
+{
+
+ public Discord.Discord discord;
+
+ // Use this for initialization
+ void Start () {
+ System.Environment.SetEnvironmentVariable("DISCORD_INSTANCE_ID", "0");
+ discord = new Discord.Discord(784835227338932244, (System.UInt64)Discord.CreateFlags.Default);
+ var activityManager = discord.GetActivityManager();
+ var activity = new Discord.Activity
+ {
+ State = "In Development...",
+ Details = "An upcoming Unity game by Alee!",
+ Assets =
+ {
+ LargeImage = "wip",
+ LargeText = "Work in Progress!"
+ }
+ };
+ activityManager.UpdateActivity(activity, (res) =>
+ {
+ if (res == Discord.Result.Ok)
+ {
+ Debug.LogWarning("Everything is fine!");
+ }
+ });
+
+ activityManager.ClearActivity((result) =>
+ {
+ if (result == Discord.Result.Ok)
+ {
+ Debug.Log("Success!");
+ }
+ else
+ {
+ Debug.LogError("Failed");
+ }
+ });
+ }
+
+ // Update is called once per frame
+ void Update () {
+ discord.RunCallbacks();
+ }
+}
|
