From a089aab53e118b8eec7143ff8e066a964164949a Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Tue, 17 Oct 2017 13:33:12 -0700 Subject: [PATCH] Update unity. --- .../Assets/DiscordController.cs | 15 +++++++++++++++ examples/button-clicker/Assets/DiscordRpc.cs | 2 +- .../Assets/Resources/discord-rpc.dll | Bin 62464 -> 62464 bytes examples/button-clicker/Assets/main.unity | 15 +++++++++++++++ .../ProjectSettings/ProjectVersion.txt | 2 +- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/examples/button-clicker/Assets/DiscordController.cs b/examples/button-clicker/Assets/DiscordController.cs index d00b51b..48bf503 100644 --- a/examples/button-clicker/Assets/DiscordController.cs +++ b/examples/button-clicker/Assets/DiscordController.cs @@ -1,5 +1,14 @@ using UnityEngine; +[System.Serializable] +public class DiscordJoinEvent : UnityEngine.Events.UnityEvent { } + +[System.Serializable] +public class DiscordSpectateEvent : UnityEngine.Events.UnityEvent { } + +[System.Serializable] +public class DiscordJoinRequestEvent : UnityEngine.Events.UnityEvent { } + public class DiscordController : MonoBehaviour { public DiscordRpc.RichPresence presence; @@ -9,6 +18,9 @@ public class DiscordController : MonoBehaviour public int clickCounter; public UnityEngine.Events.UnityEvent onConnect; public UnityEngine.Events.UnityEvent onDisconnect; + public DiscordJoinEvent onJoin; + public DiscordJoinEvent onSpectate; + public DiscordJoinRequestEvent onJoinRequest; DiscordRpc.EventHandlers handlers; @@ -46,18 +58,21 @@ public class DiscordController : MonoBehaviour { ++callbackCalls; Debug.Log(string.Format("Discord: join ({0})", secret)); + onJoin.Invoke(secret); } public void SpectateCallback(string secret) { ++callbackCalls; Debug.Log(string.Format("Discord: spectate ({0})", secret)); + onSpectate.Invoke(secret); } public void RequestCallback(DiscordRpc.JoinRequest request) { ++callbackCalls; Debug.Log(string.Format("Discord: join request {0}: {1}", request.username, request.userId)); + onJoinRequest.Invoke(request); } void Start() diff --git a/examples/button-clicker/Assets/DiscordRpc.cs b/examples/button-clicker/Assets/DiscordRpc.cs index 44cbf3f..206504e 100644 --- a/examples/button-clicker/Assets/DiscordRpc.cs +++ b/examples/button-clicker/Assets/DiscordRpc.cs @@ -58,7 +58,7 @@ public class DiscordRpc [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] public string username; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public string avatarUrl; + public string avatar; } public enum Reply diff --git a/examples/button-clicker/Assets/Resources/discord-rpc.dll b/examples/button-clicker/Assets/Resources/discord-rpc.dll index 283b98af2e1cf0a3bdafa6b6d70265ec63bc8da7..5daec3dbe31aac73275fcb9b888e2d7815ed059f 100644 GIT binary patch delta 36 mcmZp8!QAkId4m8W^P$vdn}rz{t^hN(uUsnvW~A?%X$k-^ED=%w delta 36 mcmZp8!QAkId4m8W^Q8|DHVZQ@TmfcmU%6HU%t+ri(-Z(qUK0@j diff --git a/examples/button-clicker/Assets/main.unity b/examples/button-clicker/Assets/main.unity index b044ae3..ab1666d 100644 --- a/examples/button-clicker/Assets/main.unity +++ b/examples/button-clicker/Assets/main.unity @@ -703,6 +703,21 @@ MonoBehaviour: m_CallState: 2 m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + onJoin: + m_PersistentCalls: + m_Calls: [] + m_TypeName: DiscordJoinEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onSpectate: + m_PersistentCalls: + m_Calls: [] + m_TypeName: DiscordJoinEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onJoinRequest: + m_PersistentCalls: + m_Calls: [] + m_TypeName: DiscordJoinRequestEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null --- !u!4 &1929635630 Transform: m_ObjectHideFlags: 0 diff --git a/examples/button-clicker/ProjectSettings/ProjectVersion.txt b/examples/button-clicker/ProjectSettings/ProjectVersion.txt index ca1aa05..a211ccd 100644 --- a/examples/button-clicker/ProjectSettings/ProjectVersion.txt +++ b/examples/button-clicker/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.1.0f3 +m_EditorVersion: 2017.1.1f1