diff --git a/Assemblies/ILMerge.exe b/Assemblies/ILMerge.exe new file mode 100644 index 0000000..e401808 Binary files /dev/null and b/Assemblies/ILMerge.exe differ diff --git a/TwitchLib.Unity/Api.cs b/TwitchLib.Unity/Api.cs index 23449bf..42fae61 100644 --- a/TwitchLib.Unity/Api.cs +++ b/TwitchLib.Unity/Api.cs @@ -1,14 +1,10 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; -using System.Text; using System.Threading.Tasks; using TwitchLib.Api; using TwitchLib.Api.Interfaces; -using TwitchLib.Api.Sections; using UnityEngine; namespace TwitchLib.Unity diff --git a/TwitchLib.Unity/Client.cs b/TwitchLib.Unity/Client.cs index b787156..798cd3f 100644 --- a/TwitchLib.Unity/Client.cs +++ b/TwitchLib.Unity/Client.cs @@ -250,6 +250,8 @@ public Client() : base(null) base.OnRitualNewChatter += ((object sender, OnRitualNewChatterArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnRitualNewChatter?.Invoke(sender, e)); }); base.OnFailureToReceiveJoinConfirmation += ((object sender, OnFailureToReceiveJoinConfirmationArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnFailureToReceiveJoinConfirmation?.Invoke(sender, e)); }); base.OnUnaccountedFor += ((object sender, OnUnaccountedForArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnUnaccountedFor?.Invoke(sender, e)); }); + base.OnSelfRaidError += ((object sender, EventArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnSelfRaidError?.Invoke(sender, e)); }); + base.OnNoPermissionError += ((object sender, EventArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnNoPermissionError?.Invoke(sender, e)); }); } } } diff --git a/TwitchLib.Unity/ColorExtension.cs b/TwitchLib.Unity/ColorExtension.cs new file mode 100644 index 0000000..28e9b8b --- /dev/null +++ b/TwitchLib.Unity/ColorExtension.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TwitchLib.Unity +{ + public static class ColorExtension + { + public static UnityEngine.Color ToUnity(this System.Drawing.Color color) + { + return new UnityEngine.Color(color.R, color.G, color.B, color.A); + } + } + +} diff --git a/TwitchLib.Unity/ThreadDispatcher.cs b/TwitchLib.Unity/ThreadDispatcher.cs index a887c5b..b625dcd 100644 --- a/TwitchLib.Unity/ThreadDispatcher.cs +++ b/TwitchLib.Unity/ThreadDispatcher.cs @@ -1,9 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using UnityEngine; namespace TwitchLib.Unity diff --git a/TwitchLib.Unity/TwitchLib.Unity.csproj b/TwitchLib.Unity/TwitchLib.Unity.csproj index 7afead7..3cf7cdd 100644 --- a/TwitchLib.Unity/TwitchLib.Unity.csproj +++ b/TwitchLib.Unity/TwitchLib.Unity.csproj @@ -42,6 +42,6 @@ - + diff --git a/TwitchLib.Unity/UnityFollowerService.cs b/TwitchLib.Unity/UnityFollowerService.cs index b0c2724..3cc886e 100644 --- a/TwitchLib.Unity/UnityFollowerService.cs +++ b/TwitchLib.Unity/UnityFollowerService.cs @@ -1,15 +1,13 @@ using System; -using System.Net; using UnityEngine; -using TwitchLib.Api; -using TwitchLib.Api.Enums; using TwitchLib.Api.Interfaces; using TwitchLib.Api.Services; -using TwitchLib.Api.Services.Exceptions; using TwitchLib.Api.Services.Events.FollowerService; -namespace TwitchLib.Unity { - public class UnityFollowerService : FollowerService { +namespace TwitchLib.Unity +{ + public class UnityFollowerService : FollowerService + { private readonly GameObject _threadDispatcher; #region Events @@ -22,7 +20,7 @@ public class UnityFollowerService : FollowerService { #endregion public UnityFollowerService(ITwitchAPI api, int checkIntervalSeconds = 60, int queryCount = 25) : base(api, checkIntervalSeconds, queryCount) { - _threadDispatcher = new GameObject("ThreadDispatcher"); + _threadDispatcher = new GameObject("UnityFollowerServiceThreadDispatcher"); _threadDispatcher.AddComponent(); UnityEngine.Object.DontDestroyOnLoad(_threadDispatcher); diff --git a/TwitchLib.Unity/UnityLiveStreamMonitor.cs b/TwitchLib.Unity/UnityLiveStreamMonitor.cs index 3644031..448eb7f 100644 --- a/TwitchLib.Unity/UnityLiveStreamMonitor.cs +++ b/TwitchLib.Unity/UnityLiveStreamMonitor.cs @@ -1,15 +1,13 @@ using System; -using System.Net; using UnityEngine; -using TwitchLib.Api; -using TwitchLib.Api.Enums; using TwitchLib.Api.Interfaces; using TwitchLib.Api.Services; -using TwitchLib.Api.Services.Exceptions; using TwitchLib.Api.Services.Events.LiveStreamMonitor; -namespace TwitchLib.Unity { - public class UnityLiveStreamMonitor : LiveStreamMonitor { +namespace TwitchLib.Unity +{ + public class UnityLiveStreamMonitor : LiveStreamMonitor + { private readonly GameObject _threadDispatcher; #region EVENTS @@ -27,8 +25,8 @@ public class UnityLiveStreamMonitor : LiveStreamMonitor { public new event EventHandler OnStreamsSet; #endregion - public UnityFollowerService(ITwitchAPI api, int checkIntervalSeconds = 60, bool checkStatusOnStart = true, bool invokeEventsOnStart = false) : base(api, checkIntervalSeconds, checkStatusOnStart, invokeEventsOnStart) { - _threadDispatcher = new GameObject("ThreadDispatcher"); + public UnityLiveStreamMonitor(ITwitchAPI api, int checkIntervalSeconds = 60, bool checkStatusOnStart = true, bool invokeEventsOnStart = false) : base(api, checkIntervalSeconds, checkStatusOnStart, invokeEventsOnStart) { + _threadDispatcher = new GameObject("UnityLiveStreamMonitorThreadDispatcher"); _threadDispatcher.AddComponent(); UnityEngine.Object.DontDestroyOnLoad(_threadDispatcher);