diff --git a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/DependencyResolver.cs b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/DependencyResolver.cs index dfbe814..3f066a6 100644 --- a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/DependencyResolver.cs +++ b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/DependencyResolver.cs @@ -1,11 +1,14 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; +using Furality.SDK.Editor.DependencyResolving.Providers; +using Furality.SDK.Editor.DependencyResolving.Providers.External; +using Furality.SDK.Editor.DependencyResolving.Providers.Internal; +using Furality.SDK.Editor.External.AssetHandling; using Furality.SDK.Editor.External.VCC; using Furality.SDK.Editor.Helpers; using UnityEngine; -namespace Furality.SDK.DependencyResolving +namespace Furality.SDK.Editor.DependencyResolving { public class DependencyResolver { diff --git a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/External/ProjectPackage.cs b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/External/ProjectPackage.cs index 52cd053..8975f07 100644 --- a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/External/ProjectPackage.cs +++ b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/External/ProjectPackage.cs @@ -1,9 +1,8 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; +using Furality.SDK.Editor.External.AssetHandling; using Furality.SDK.Editor.External.VCC; -using UnityEngine; -namespace Furality.SDK.DependencyResolving +namespace Furality.SDK.Editor.DependencyResolving.Providers.External { public class ProjectPackage : IDependencyProvider { diff --git a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/IDependencyProvider.cs b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/IDependencyProvider.cs index 7f334a7..5fba562 100644 --- a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/IDependencyProvider.cs +++ b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/IDependencyProvider.cs @@ -1,7 +1,7 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; +using Furality.SDK.Editor.External.AssetHandling; -namespace Furality.SDK.DependencyResolving +namespace Furality.SDK.Editor.DependencyResolving.Providers { public interface IDependencyProvider { diff --git a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/Internal/LocalDependencyProvider.cs b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/Internal/LocalDependencyProvider.cs index 1e5c358..8b6c9f8 100644 --- a/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/Internal/LocalDependencyProvider.cs +++ b/Assets/Furality/FuralitySDK/Editor/DependencyResolving/Providers/Internal/LocalDependencyProvider.cs @@ -1,13 +1,12 @@ using System; using System.Linq; using System.Threading.Tasks; -using Furality.SDK.Editor; +using Furality.SDK.Editor.External.AssetHandling; using Furality.SDK.Editor.Helpers; -using Furality.SDK.External.Assets; using UnityEditor; using UnityEngine; -namespace Furality.SDK.DependencyResolving +namespace Furality.SDK.Editor.DependencyResolving.Providers.Internal { /** * Local dependency resolver is responsible for removing our requirement for the VCC. diff --git a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/AssetClass.cs b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/AssetClass.cs index c9534d2..63f7b0c 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/AssetClass.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/AssetClass.cs @@ -5,7 +5,7 @@ using UnityEditor; using UnityEngine; -namespace Furality.SDK.External.Assets +namespace Furality.SDK.Editor.External.AssetHandling { public class AssetClass { diff --git a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/FuralityPackage.cs b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/FuralityPackage.cs index 41562c8..ce58610 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/FuralityPackage.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/FuralityPackage.cs @@ -1,7 +1,7 @@ using System; -using Furality.SDK.External.Api; +using Furality.SDK.Editor.External.FoxApi; -namespace Furality.SDK.External.Assets +namespace Furality.SDK.Editor.External.AssetHandling { public class FuralityPackage : Package { diff --git a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/IPackageDataSource.cs b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/IPackageDataSource.cs index d5c1960..6b42e1c 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/IPackageDataSource.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/IPackageDataSource.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using JetBrains.Annotations; -namespace Furality.SDK.External.Assets +namespace Furality.SDK.Editor.External.AssetHandling { public interface IPackageDataSource { diff --git a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/Package.cs b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/Package.cs index 52bcfd2..08f1fb3 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/Package.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/Package.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Furality.SDK +namespace Furality.SDK.Editor.External.AssetHandling { public class Package { diff --git a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/PrivilegeCategory.cs b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/PrivilegeCategory.cs index 7eff524..3a810b7 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/PrivilegeCategory.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/AssetHandling/PrivilegeCategory.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Furality.SDK.Editor.External.FoxApi; using Furality.SDK.Editor.Pages; -using Furality.SDK.External.Api; using UnityEditor; using UnityEngine; -namespace Furality.SDK.External.Assets +namespace Furality.SDK.Editor.External.AssetHandling { public class PrivilegeCategory { diff --git a/Assets/Furality/FuralitySDK/Editor/External/Boop/BoopAuth.cs b/Assets/Furality/FuralitySDK/Editor/External/Boop/BoopAuth.cs index 3dff048..b47fec7 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/Boop/BoopAuth.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/Boop/BoopAuth.cs @@ -1,11 +1,10 @@ using System; +using Furality.SDK.Editor.External.Boop.Types; using Furality.SDK.Editor.Helpers; -using Furality.SDK.External.Api; -using JetBrains.Annotations; using UnityEngine; using UnityEngine.Networking; -namespace Furality.SDK.External.Boop +namespace Furality.SDK.Editor.External.Boop { // AuthManager is our one port of call for authentication, be it initiating a login or logout, or monitoring our login state public static class BoopAuth diff --git a/Assets/Furality/FuralitySDK/Editor/External/Boop/HttpCallbackManager.cs b/Assets/Furality/FuralitySDK/Editor/External/Boop/HttpCallbackManager.cs index 4e3ab26..a0c59b2 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/Boop/HttpCallbackManager.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/Boop/HttpCallbackManager.cs @@ -3,7 +3,7 @@ using System.Net.Sockets; using System.Threading; -namespace Furality.SDK.External.Boop +namespace Furality.SDK.Editor.External.Boop { // Probably violates some http spec requirements, but it doesn't need to that secure given that its only use is for // handling the callback from the browser diff --git a/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/TokenResponse.cs b/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/TokenResponse.cs index ba298a4..b0d9fc0 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/TokenResponse.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/TokenResponse.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Boop +namespace Furality.SDK.Editor.External.Boop.Types { [Serializable] public class TokenResponse diff --git a/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/UserData.cs b/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/UserData.cs index 9306124..8ead1f8 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/UserData.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/Boop/Types/UserData.cs @@ -1,7 +1,6 @@ using System; -using Furality.SDK.External.Api; -namespace Furality.SDK.External.Boop +namespace Furality.SDK.Editor.External.Boop.Types { [Serializable] public class UserData diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/AttendanceLevel.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/AttendanceLevel.cs index da80df8..28855f4 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/AttendanceLevel.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/AttendanceLevel.cs @@ -1,4 +1,4 @@ -namespace Furality.SDK.External.Api +namespace Furality.SDK.Editor.External.FoxApi { public enum AttendanceLevel { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxFiles.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxFiles.cs index 14f7fcc..0250b21 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxFiles.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxFiles.cs @@ -2,15 +2,13 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Furality.SDK.DependencyResolving; +using Furality.SDK.Editor.DependencyResolving.Providers; +using Furality.SDK.Editor.External.AssetHandling; +using Furality.SDK.Editor.External.FoxApi.Models.Files; using Furality.SDK.Editor.Helpers; -using Furality.SDK.External.Api.Models.Files; -using Furality.SDK.External.Assets; -using JetBrains.Annotations; -using UnityEditor; using UnityEngine; -namespace Furality.SDK.External.Api.Endpoints +namespace Furality.SDK.Editor.External.FoxApi.Endpoints { public class FoxFiles : FoxResource, IDependencyProvider, IPackageDataSource { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxUsers.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxUsers.cs index b76e9e3..b6aa746 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxUsers.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Endpoints/FoxUsers.cs @@ -1,6 +1,6 @@ -using Furality.SDK.External.Api.Models.User; +using Furality.SDK.Editor.External.FoxApi.Models.User; -namespace Furality.SDK.External.Api.Endpoints +namespace Furality.SDK.Editor.External.FoxApi.Endpoints { public class FoxUsers : FoxResource { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxApi.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxApi.cs index 02c64e4..9ecc759 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxApi.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxApi.cs @@ -1,12 +1,13 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; -using Furality.SDK.External.Api.Endpoints; -using Furality.SDK.External.Boop; +using Furality.SDK.Editor.External.Boop; +using Furality.SDK.Editor.External.Boop.Types; +using Furality.SDK.Editor.External.FoxApi.Endpoints; using UnityEditor; using UnityEngine; -namespace Furality.SDK.External.Api +namespace Furality.SDK.Editor.External.FoxApi { public class FoxApi { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxResource.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxResource.cs index 42a3de9..c737b73 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxResource.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/FoxResource.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Api +namespace Furality.SDK.Editor.External.FoxApi { public abstract class FoxResource : IDisposable { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FileResponse.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FileResponse.cs index 75dc481..e38bc47 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FileResponse.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FileResponse.cs @@ -1,4 +1,4 @@ -namespace Furality.SDK.External.Api.Models.Files +namespace Furality.SDK.Editor.External.FoxApi.Models.Files { public class FileResponse { diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFileDto.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFileDto.cs index 20dcd6f..13e9962 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFileDto.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFileDto.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using Furality.SDK.External.Assets; +using Furality.SDK.Editor.External.AssetHandling; -namespace Furality.SDK.External.Api.Models.Files +namespace Furality.SDK.Editor.External.FoxApi.Models.Files { [Serializable] public class FoxFileDto : FuralityPackage diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFilesDto.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFilesDto.cs index 5391530..59aa653 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFilesDto.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/Files/FoxFilesDto.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Api.Models.Files +namespace Furality.SDK.Editor.External.FoxApi.Models.Files { [Serializable] public class FoxFilesDto diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxPatreonDto.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxPatreonDto.cs index 18b610c..b1997a6 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxPatreonDto.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxPatreonDto.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Api.Models.User +namespace Furality.SDK.Editor.External.FoxApi.Models.User { [Serializable] public class FoxPatreonDto diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxProfileDto.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxProfileDto.cs index bfbbb1f..8d5c3c9 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxProfileDto.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxProfileDto.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Api.Models.User +namespace Furality.SDK.Editor.External.FoxApi.Models.User { [Serializable] public class FoxProfileDto diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxUserDto.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxUserDto.cs index 62f7b9a..34f6f95 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxUserDto.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/Models/User/FoxUserDto.cs @@ -1,6 +1,6 @@ using System; -namespace Furality.SDK.External.Api.Models.User +namespace Furality.SDK.Editor.External.FoxApi.Models.User { [Serializable] public class FoxUserDto diff --git a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/PatreonLevel.cs b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/PatreonLevel.cs index d78cd2b..4e13eec 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/FoxApi/PatreonLevel.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/FoxApi/PatreonLevel.cs @@ -1,4 +1,4 @@ -namespace Furality.SDK.External.Api +namespace Furality.SDK.Editor.External.FoxApi { public enum PatreonLevel { diff --git a/Assets/Furality/FuralitySDK/Editor/External/VCC/Models/VccResponse.cs b/Assets/Furality/FuralitySDK/Editor/External/VCC/Models/VccResponse.cs new file mode 100644 index 0000000..5001d79 --- /dev/null +++ b/Assets/Furality/FuralitySDK/Editor/External/VCC/Models/VccResponse.cs @@ -0,0 +1,8 @@ +namespace Furality.SDK.Editor.External.VCC.Models +{ + public class VccResponse + { + public bool success; + public T data; + } +} \ No newline at end of file diff --git a/Assets/Furality/FuralitySDK/Editor/External/VCC/VccComms.cs b/Assets/Furality/FuralitySDK/Editor/External/VCC/VccComms.cs index 3573424..97e3b1e 100644 --- a/Assets/Furality/FuralitySDK/Editor/External/VCC/VccComms.cs +++ b/Assets/Furality/FuralitySDK/Editor/External/VCC/VccComms.cs @@ -1,49 +1,43 @@ using System; using System.Net.Http; using System.Threading.Tasks; +using Furality.SDK.Editor.External.VCC.Models; using UnityEngine; namespace Furality.SDK.Editor.External.VCC { public static class VccComms { - public class VccResponse - { - public bool success; - public T data; - } - private const string VccUrl = "http://localhost:5477/api/"; public static async Task> Request(string endpoint, string method, dynamic body = null) { // Send an HTTP request to the VCC - using (HttpClient client = new HttpClient()) - { - client.DefaultRequestHeaders.Add("Origin", "http://localhost:5477/"); - client.DefaultRequestHeaders.Host = "localhost"; + using HttpClient client = new HttpClient(); + + client.DefaultRequestHeaders.Add("Origin", "http://localhost:5477/"); + client.DefaultRequestHeaders.Host = "localhost"; - client.Timeout = TimeSpan.FromSeconds(1); + client.Timeout = TimeSpan.FromSeconds(1); - var request = new HttpRequestMessage(new HttpMethod(method), VccUrl+endpoint); - if (body != null) - request.Content = new StringContent(JsonUtility.ToJson(body), System.Text.Encoding.UTF8, "application/json"); + var request = new HttpRequestMessage(new HttpMethod(method), VccUrl+endpoint); + if (body != null) + request.Content = new StringContent(JsonUtility.ToJson(body), System.Text.Encoding.UTF8, "application/json"); - HttpResponseMessage response; - try - { - response = await client.SendAsync(request); - } - catch (Exception e) - { - return null; - } + HttpResponseMessage response; + try + { + response = await client.SendAsync(request); + } + catch (Exception e) + { + return null; + } - string responseBody = await response.Content.ReadAsStringAsync(); + string responseBody = await response.Content.ReadAsStringAsync(); - // Deserialize the response content into VccResponse and return - return JsonUtility.FromJson>(responseBody); - } + // Deserialize the response content into VccResponse and return + return JsonUtility.FromJson>(responseBody); } } } \ No newline at end of file diff --git a/Assets/Furality/FuralitySDK/Editor/Helpers/DependencyManager.cs b/Assets/Furality/FuralitySDK/Editor/Helpers/DependencyManager.cs index 8a8b33e..b6adeab 100644 --- a/Assets/Furality/FuralitySDK/Editor/Helpers/DependencyManager.cs +++ b/Assets/Furality/FuralitySDK/Editor/Helpers/DependencyManager.cs @@ -1,6 +1,8 @@ using System; using System.Threading.Tasks; -using Furality.SDK.DependencyResolving; +using Furality.SDK.Editor.DependencyResolving; +using Furality.SDK.Editor.DependencyResolving.Providers; +using Furality.SDK.Editor.External.AssetHandling; using Furality.SDK.Editor.External.VCC; using UnityEditor; using UnityEngine; diff --git a/Assets/Furality/FuralitySDK/Editor/Pages/DownloadsPage.cs b/Assets/Furality/FuralitySDK/Editor/Pages/DownloadsPage.cs index d47505f..a773161 100644 --- a/Assets/Furality/FuralitySDK/Editor/Pages/DownloadsPage.cs +++ b/Assets/Furality/FuralitySDK/Editor/Pages/DownloadsPage.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using Furality.SDK.External.Assets; +using Furality.SDK.Editor.External.AssetHandling; using UnityEditor; using UnityEngine; diff --git a/Assets/Furality/FuralitySDK/Editor/Pages/MainWindow.cs b/Assets/Furality/FuralitySDK/Editor/Pages/MainWindow.cs index 7241294..075474c 100644 --- a/Assets/Furality/FuralitySDK/Editor/Pages/MainWindow.cs +++ b/Assets/Furality/FuralitySDK/Editor/Pages/MainWindow.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; +using Furality.SDK.Editor.External.Boop; +using Furality.SDK.Editor.External.FoxApi; using Furality.SDK.Editor.Helpers; -using Furality.SDK.External.Api; -using Furality.SDK.External.Boop; using UnityEditor; using UnityEditor.PackageManager; using UnityEngine; @@ -13,7 +12,6 @@ namespace Furality.SDK.Editor.Pages [InitializeOnLoad] public class MainWindow : EditorWindow { - private readonly Queue _dispatchQueue = new Queue(); private Dictionary _pages = new Dictionary(); private MenuPage _currentPage; diff --git a/Assets/Furality/FuralitySDK/Editor/Pages/SettingsPage.cs b/Assets/Furality/FuralitySDK/Editor/Pages/SettingsPage.cs index 31501a0..708e497 100644 --- a/Assets/Furality/FuralitySDK/Editor/Pages/SettingsPage.cs +++ b/Assets/Furality/FuralitySDK/Editor/Pages/SettingsPage.cs @@ -1,4 +1,4 @@ -using Furality.SDK.External.Boop; +using Furality.SDK.Editor.External.Boop; using UnityEditor; using UnityEngine; @@ -7,6 +7,7 @@ namespace Furality.SDK.Editor.Pages public class SettingsPage : MenuPage { private bool _authExpanded = true; + private GUIStyle _guiStyle; public SettingsPage(MainWindow mainWindow) : base(mainWindow) { @@ -14,7 +15,7 @@ public SettingsPage(MainWindow mainWindow) : base(mainWindow) public override void Draw() { - var guiStyle = new GUIStyle(GUI.skin.box) + _guiStyle ??= new GUIStyle(GUI.skin.box) { normal = { @@ -28,63 +29,60 @@ public override void Draw() _authExpanded = EditorGUILayout.Foldout(_authExpanded, "Authentication"); - if (_authExpanded) - { - EditorGUI.indentLevel++; - EditorGUILayout.BeginVertical(guiStyle); + if (!_authExpanded) return; + EditorGUI.indentLevel++; + EditorGUILayout.BeginVertical(_guiStyle); - var foxApi = MainWindow.Api; - + var foxApi = MainWindow.Api; - if (foxApi.IsLoggedIn) // If we're logged in and have a valid user - { - var cachedProfile = MainWindow.Api.UsersApi.CurrentUser; + if (foxApi.IsLoggedIn) // If we're logged in and have a valid user + { + var cachedProfile = MainWindow.Api.UsersApi.CurrentUser; - EditorGUILayout.BeginHorizontal(guiStyle); - var centerStyle = new GUIStyle(GUI.skin.label) - { - alignment = TextAnchor.MiddleCenter - }; + EditorGUILayout.BeginHorizontal(_guiStyle); + var centerStyle = new GUIStyle(GUI.skin.label) + { + alignment = TextAnchor.MiddleCenter + }; - EditorGUILayout.LabelField("Logged in as: ", centerStyle, GUILayout.Width(100)); - EditorGUILayout.LabelField(cachedProfile.displayName, centerStyle); + EditorGUILayout.LabelField("Logged in as: ", centerStyle, GUILayout.Width(100)); + EditorGUILayout.LabelField(cachedProfile.displayName, centerStyle); - EditorGUILayout.EndHorizontal(); + EditorGUILayout.EndHorizontal(); - EditorGUILayout.BeginHorizontal(guiStyle); + EditorGUILayout.BeginHorizontal(_guiStyle); - EditorGUILayout.LabelField("Attendance: ", centerStyle, GUILayout.Width(100)); - EditorGUILayout.LabelField(cachedProfile.GetLevel().ToString(), centerStyle); - EditorGUILayout.EndHorizontal(); + EditorGUILayout.LabelField("Attendance: ", centerStyle, GUILayout.Width(100)); + EditorGUILayout.LabelField(cachedProfile.GetLevel().ToString(), centerStyle); + EditorGUILayout.EndHorizontal(); - EditorGUILayout.BeginHorizontal(guiStyle); - EditorGUILayout.LabelField("Patreon: ", centerStyle, GUILayout.Width(100)); - EditorGUILayout.LabelField(cachedProfile.patreon.GetTier().ToString(), centerStyle); - EditorGUILayout.EndHorizontal(); + EditorGUILayout.BeginHorizontal(_guiStyle); + EditorGUILayout.LabelField("Patreon: ", centerStyle, GUILayout.Width(100)); + EditorGUILayout.LabelField(cachedProfile.patreon.GetTier().ToString(), centerStyle); + EditorGUILayout.EndHorizontal(); - EditorGUILayout.Space(); + EditorGUILayout.Space(); - if (GUILayout.Button("Logout")) - { - BoopAuth.Logout(); - } + if (GUILayout.Button("Logout")) + { + BoopAuth.Logout(); } - else + } + else + { + bool isLoggingIn = BoopAuth.IsAwaitingCallback; + GUI.enabled = !isLoggingIn; + if (GUILayout.Button(!isLoggingIn ? "Login" : "Logging in...")) { - bool isLoggingIn = BoopAuth.IsAwaitingCallback; - GUI.enabled = !isLoggingIn; - if (GUILayout.Button(!isLoggingIn ? "Login" : "Logging in...")) - { - BoopAuth.Login(); - } - GUI.enabled = true; + BoopAuth.Login(); } + GUI.enabled = true; + } - EditorGUILayout.EndVertical(); + EditorGUILayout.EndVertical(); - EditorGUI.indentLevel--; - } + EditorGUI.indentLevel--; } } } \ No newline at end of file diff --git a/Assets/Furality/FuralitySDK/Editor/Pages/ToolsPage.cs b/Assets/Furality/FuralitySDK/Editor/Pages/ToolsPage.cs index 5f5713f..1c4f4fe 100644 --- a/Assets/Furality/FuralitySDK/Editor/Pages/ToolsPage.cs +++ b/Assets/Furality/FuralitySDK/Editor/Pages/ToolsPage.cs @@ -36,8 +36,7 @@ public ToolsPage(MainWindow mainWindow) : base(mainWindow) var name = string.Concat(type.Name.Select(x => char.IsUpper(x) ? " " + x : x.ToString())).TrimStart(' '); // Add it to our list of windows (if it doesn't already exist) - if (!_windows.ContainsKey(name)) - _windows.Add(name, type); + _windows.TryAdd(name, type); } } diff --git a/Assets/Furality/FuralitySDK/Editor/TestDataSource.cs b/Assets/Furality/FuralitySDK/Editor/TestDataSource.cs index f1ffab8..94d029d 100644 --- a/Assets/Furality/FuralitySDK/Editor/TestDataSource.cs +++ b/Assets/Furality/FuralitySDK/Editor/TestDataSource.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using Furality.SDK.External.Api; -using Furality.SDK.External.Assets; +using Furality.SDK.Editor.External.AssetHandling; +using Furality.SDK.Editor.External.FoxApi; using JetBrains.Annotations; using UnityEditor; using UnityEngine;