Made the RPC modules a public string

This commit is contained in:
Andrew Lee 2020-12-05 14:29:05 -05:00
parent 0f7e3ced25
commit 8eeb75a44b
Signed by: andrew
GPG key ID: 4DCE67C47836D125
3 changed files with 16 additions and 5 deletions

View file

@ -30,6 +30,7 @@
<Path>.idea</Path>
<Path>Build</Path>
<Path>Library</Path>
<Path>Temp</Path>
<Path>obj</Path>
</explicitExcludes>
</component>

View file

@ -2285,6 +2285,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4cb25a675054556c4b6a193453e179c1, type: 3}
m_Name:
m_EditorClassIdentifier:
ApplicationID: 784835227338932244
RpcStatus: In Development...
RpcDetails: An upcoming Unity game by Alee!
RpcLargeImage: wip
RpcLargeImageText: Work in Progress!
--- !u!4 &2140247659
Transform:
m_ObjectHideFlags: 0

View file

@ -4,20 +4,25 @@ public class DiscordController : MonoBehaviour
{
public Discord.Discord discord;
public long ApplicationID;
public string RpcStatus;
public string RpcDetails;
public string RpcLargeImage;
public string RpcLargeImageText;
// Use this for initialization
void Start () {
System.Environment.SetEnvironmentVariable("DISCORD_INSTANCE_ID", "0");
discord = new Discord.Discord(784835227338932244, (System.UInt64)Discord.CreateFlags.Default);
discord = new Discord.Discord(ApplicationID, (System.UInt64)Discord.CreateFlags.Default);
var activityManager = discord.GetActivityManager();
var activity = new Discord.Activity
{
State = "In Development...",
Details = "An upcoming Unity game by Alee!",
State = RpcStatus,
Details = RpcDetails,
Assets =
{
LargeImage = "wip",
LargeText = "Work in Progress!"
LargeImage = RpcLargeImage,
LargeText = RpcLargeImageText
}
};
activityManager.UpdateActivity(activity, (res) =>