├── .gitignore ├── .gitmodules ├── Spotify4Unity ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── XRSettings.asset │ ├── VersionControlSettings.asset │ ├── TimeManager.asset │ ├── EditorBuildSettings.asset │ ├── VFXManager.asset │ ├── AudioManager.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── EditorSettings.asset │ ├── PackageManagerSettings.asset │ ├── DynamicsManager.asset │ ├── NavMeshAreas.asset │ ├── Physics2DSettings.asset │ ├── GraphicsSettings.asset │ └── SceneTemplateSettings.json ├── .vsconfig ├── Assets │ ├── Spotify4Unity │ │ ├── Plugins │ │ │ ├── EmbedIO.dll │ │ │ ├── Swan.Lite.dll │ │ │ ├── SpotifyAPI.Web.dll │ │ │ ├── SpotifyAPI.Web.Auth.dll │ │ │ ├── EmbedIO.dll.meta │ │ │ ├── Swan.Lite.dll.meta │ │ │ ├── SpotifyAPI.Web.dll.meta │ │ │ └── SpotifyAPI.Web.Auth.dll.meta │ │ ├── Examples │ │ │ ├── Images │ │ │ │ ├── UI │ │ │ │ │ ├── home-icon.png │ │ │ │ │ ├── heart-icon.png │ │ │ │ │ ├── media-pause.png │ │ │ │ │ ├── media-play.png │ │ │ │ │ ├── search-icon.png │ │ │ │ │ ├── user-follow.png │ │ │ │ │ ├── volume-max.png │ │ │ │ │ ├── volume-mute.png │ │ │ │ │ ├── LoadingSpinner.png │ │ │ │ │ ├── media-shuffle.png │ │ │ │ │ ├── media-repeat-none.png │ │ │ │ │ ├── media-step-backward.png │ │ │ │ │ ├── media-step-forward.png │ │ │ │ │ ├── heart-icon.png.meta │ │ │ │ │ ├── home-icon.png.meta │ │ │ │ │ ├── media-pause.png.meta │ │ │ │ │ ├── media-play.png.meta │ │ │ │ │ ├── search-icon.png.meta │ │ │ │ │ ├── volume-max.png.meta │ │ │ │ │ ├── volume-mute.png.meta │ │ │ │ │ ├── LoadingSpinner.png.meta │ │ │ │ │ ├── media-shuffle.png.meta │ │ │ │ │ ├── media-repeat-none.png.meta │ │ │ │ │ ├── media-step-backward.png.meta │ │ │ │ │ ├── media-step-forward.png.meta │ │ │ │ │ └── user-follow.png.meta │ │ │ │ └── UI.meta │ │ │ ├── Scripts │ │ │ │ ├── Spotify App │ │ │ │ │ ├── Views │ │ │ │ │ │ ├── PlaylistViewController.cs │ │ │ │ │ │ ├── ViewControllerBase.cs │ │ │ │ │ │ ├── LandingViewController.cs.meta │ │ │ │ │ │ ├── LikedSongsController.cs.meta │ │ │ │ │ │ ├── SearchViewController.cs.meta │ │ │ │ │ │ ├── ViewControllerBase.cs.meta │ │ │ │ │ │ ├── PlaylistViewController.cs.meta │ │ │ │ │ │ ├── LandingViewController.cs │ │ │ │ │ │ ├── LikedSongsController.cs │ │ │ │ │ │ └── SearchViewController.cs │ │ │ │ │ ├── Views.meta │ │ │ │ │ ├── Prefabs.meta │ │ │ │ │ ├── AppMainContentController.cs.meta │ │ │ │ │ ├── SpotifyPlayerController.cs.meta │ │ │ │ │ ├── PlaylistsNavigationController.cs.meta │ │ │ │ │ ├── Prefabs │ │ │ │ │ │ ├── SingleNavPlaylistController.cs.meta │ │ │ │ │ │ ├── SinglePlaylistSelectableTrack.cs.meta │ │ │ │ │ │ ├── SingleSearchTrackController.cs.meta │ │ │ │ │ │ ├── SingleNavPlaylistController.cs │ │ │ │ │ │ ├── SingleSearchTrackController.cs │ │ │ │ │ │ └── SinglePlaylistSelectableTrack.cs │ │ │ │ │ ├── AppMainContentController.cs │ │ │ │ │ └── PlaylistsNavigationController.cs │ │ │ │ ├── Widgets.meta │ │ │ │ ├── Spotify App.meta │ │ │ │ ├── Landing Scene.meta │ │ │ │ ├── LoadingSpinner.cs.meta │ │ │ │ ├── Landing Scene │ │ │ │ │ ├── UserWidgetController.cs.meta │ │ │ │ │ ├── AccountStatusController.cs.meta │ │ │ │ │ ├── ArtistWidgetController.cs.meta │ │ │ │ │ ├── PlaylistWidgetController.cs.meta │ │ │ │ │ ├── SinglePlaylistController.cs.meta │ │ │ │ │ ├── AccountStatusController.cs │ │ │ │ │ ├── SinglePlaylistController.cs │ │ │ │ │ ├── PlaylistWidgetController.cs │ │ │ │ │ ├── ArtistWidgetController.cs │ │ │ │ │ └── UserWidgetController.cs │ │ │ │ ├── Widgets │ │ │ │ │ ├── SingleArtistWidgetController.cs.meta │ │ │ │ │ └── SingleArtistWidgetController.cs │ │ │ │ └── LoadingSpinner.cs │ │ │ ├── Scenes │ │ │ │ ├── Landing Scene.unity.meta │ │ │ │ └── Spotify App.unity.meta │ │ │ ├── Images.meta │ │ │ ├── Materials.meta │ │ │ ├── Prefabs.meta │ │ │ ├── Prefabs │ │ │ │ ├── Loading Spinner.prefab.meta │ │ │ │ ├── Single Playlist Prefab.prefab.meta │ │ │ │ ├── Widgets.meta │ │ │ │ ├── Widgets │ │ │ │ │ ├── Artist Widget.prefab.meta │ │ │ │ │ ├── Sign In_Out Widget.prefab.meta │ │ │ │ │ ├── Simple Artist Widget.prefab.meta │ │ │ │ │ ├── User Widget - UserID.prefab.meta │ │ │ │ │ └── User Widget - Private User.prefab.meta │ │ │ │ ├── Spotify App.meta │ │ │ │ ├── Spotify App │ │ │ │ │ ├── Views.meta │ │ │ │ │ ├── Views │ │ │ │ │ │ ├── Landing View.prefab.meta │ │ │ │ │ │ ├── Search View.prefab.meta │ │ │ │ │ │ ├── Liked Songs View.prefab.meta │ │ │ │ │ │ └── Playlist Scroll View.prefab.meta │ │ │ │ │ ├── Search.meta │ │ │ │ │ ├── Single Nav Playlist Item.prefab.meta │ │ │ │ │ ├── Single Playlist Track.prefab.meta │ │ │ │ │ └── Search │ │ │ │ │ │ └── Search Single Track.prefab.meta │ │ │ │ └── Loading Spinner.prefab │ │ │ ├── Scenes.meta │ │ │ ├── Scripts.meta │ │ │ └── Materials │ │ │ │ ├── SpotifyPallet_ActiveGreen.mat.meta │ │ │ │ ├── SpotifyPallet_Scrollbar.mat.meta │ │ │ │ ├── SpotifyPallet_BackgroundBlack.mat.meta │ │ │ │ ├── SpotifyPallet_BackgroundDark.mat.meta │ │ │ │ ├── SpotifyPallet_BackgroundLight.mat.meta │ │ │ │ ├── SpotifyPallet_BackgroundBlack.mat │ │ │ │ ├── SpotifyPallet_Scrollbar.mat │ │ │ │ ├── SpotifyPallet_ActiveGreen.mat │ │ │ │ ├── SpotifyPallet_BackgroundDark.mat │ │ │ │ └── SpotifyPallet_BackgroundLight.mat │ │ ├── Core.meta │ │ ├── Editor.meta │ │ ├── Examples.meta │ │ ├── Plugins.meta │ │ ├── Unity.meta │ │ ├── Core │ │ │ ├── Services.meta │ │ │ ├── Managed Authentification.meta │ │ │ ├── Managed Authentification │ │ │ │ ├── PKCE.meta │ │ │ │ ├── Implicit Grant.meta │ │ │ │ ├── Client Credentials.meta │ │ │ │ ├── Implicit Grant │ │ │ │ │ ├── ImplicitGrant_AuthConfig.cs │ │ │ │ │ ├── ImplicitGrant_AuthConfig.cs.meta │ │ │ │ │ ├── ImplicitGrant_Authentification.cs.meta │ │ │ │ │ └── ImplicitGrant_Authentification.cs │ │ │ │ ├── AuthorizationConfig.cs.meta │ │ │ │ ├── IServiceAuthenticator.cs.meta │ │ │ │ ├── PKCE │ │ │ │ │ ├── PKCE_AuthConfig.cs.meta │ │ │ │ │ ├── PKCE_Authentification.cs.meta │ │ │ │ │ └── PKCE_AuthConfig.cs │ │ │ │ ├── Client Credentials │ │ │ │ │ ├── ClientCredentials_AuthConfig.cs.meta │ │ │ │ │ ├── ClientCredentials_Authentification.cs.meta │ │ │ │ │ ├── ClientCredentials_AuthConfig.cs │ │ │ │ │ └── ClientCredentials_Authentification.cs │ │ │ │ ├── IServiceAuthenticator.cs │ │ │ │ └── AuthorizationConfig.cs │ │ │ ├── S4UUtility.cs.meta │ │ │ └── Services │ │ │ │ └── SpotifyService.cs.meta │ │ ├── Dependencies.meta │ │ ├── Editor │ │ │ ├── Configs.meta │ │ │ ├── Configs │ │ │ │ ├── ImplicitGrantConfigView.cs │ │ │ │ ├── PKCEAuthConfigView.cs.meta │ │ │ │ ├── AuthorizationConfigView.cs.meta │ │ │ │ ├── ImplicitGrantConfigView.cs.meta │ │ │ │ ├── ClientCredentialsConfigView.cs.meta │ │ │ │ ├── ClientCredentialsConfigView.cs │ │ │ │ ├── PKCEAuthConfigView.cs │ │ │ │ └── AuthorizationConfigView.cs │ │ │ ├── SpotifyServiceView.cs.meta │ │ │ └── SpotifyServiceView.cs │ │ ├── Dependencies │ │ │ ├── UnitySingleton.meta │ │ │ └── UnitySingleton │ │ │ │ ├── SceneSingleton.cs.meta │ │ │ │ └── SceneSingleton.cs │ │ └── Unity │ │ │ ├── SpotifyPlayerListener.cs.meta │ │ │ ├── SpotifyServiceListener.cs.meta │ │ │ ├── SpotifyServiceListener.cs │ │ │ └── SpotifyPlayerListener.cs │ ├── Scenes │ │ ├── SampleScene.unity.meta │ │ └── SampleScene.unity │ ├── Scenes.meta │ └── Spotify4Unity.meta ├── .gitignore ├── Spotify4Unity.sln └── Packages │ └── manifest.json ├── tools └── wiki-tool │ ├── README.md │ └── GithubWiki2HTML.bat ├── .github └── funding.yml ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | tools/wiki-tool/Spotify4Unity.wiki/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/wiki-tool/Spotify4Unity.wiki"] 2 | url = https://github.com/joshlmao/spotify4unity.wiki.git 3 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.1.10f1 2 | m_EditorVersionWithRevision: 2021.1.10f1 (b15f561b2cef) 3 | -------------------------------------------------------------------------------- /Spotify4Unity/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/EmbedIO.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Plugins/EmbedIO.dll -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/Swan.Lite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Plugins/Swan.Lite.dll -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.dll -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/home-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/home-icon.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.Auth.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.Auth.dll -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/heart-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/heart-icon.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-pause.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-play.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/search-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/search-icon.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/user-follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/user-follow.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-max.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-mute.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/LoadingSpinner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/LoadingSpinner.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-shuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-shuffle.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-repeat-none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-repeat-none.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-backward.png -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-forward.png -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84ba5642b962c214c9ac8905e5c5043f 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0e4a21af714cb84eaddffdcf03b4825 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 099b854d8300e2345919973c58295d44 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 799d4ffafad127c4195a27e81e245838 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/PlaylistViewController.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JoshLmao/Spotify4Unity/HEAD/Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/PlaylistViewController.cs -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b17afada6ea53ed438709692fa39664f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19d1c5541cff02945b4f179748c5b76a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96c10b793c1d87946a2d1446deecad95 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9499dc8dcbbbc7e4b8f9aaadff76028d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Services.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d83618c1883e4304ab7581102b888b3a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Dependencies.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b16ff8cd824c4894a904234cc2819377 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68fc5566a8850f04aa44dce3c7dd8727 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scenes/Landing Scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scenes/Spotify App.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e76123246cebb545917c7ce05bcfcab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5597a68901009d541bc28753266c0771 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 780d8c8e7e3a24e4cad7eb4bab8298f3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37f4d142b2948844fb42882d55373e17 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e925a9cc0cfcbc4695759f5733b96e7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Loading Spinner.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da4c21c286690f64d9ff10b794adf3e9 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 551e5f45b4761e241840f1dc54e02790 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4da3e266d7be9a840af9bbfc7c06b5fb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Single Playlist Prefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d7d78826b367864db2ea300f496ecce 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bfa6da0ca8721d4b98cb5e278d66922 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets/Artist Widget.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1e337f5fb11d364798599114afcd93a 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Widgets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46aaaf859a07d4d4ab4592575a65f669 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03b26fc62172c074bb23097e0a2d23ef 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Dependencies/UnitySingleton.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02ec909ac6a811c4b82a9e7000c110e8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c67f7b259771f614fab4ec14c1cf4ccc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets/Sign In_Out Widget.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdb59ee9b74f76844ba4d9207ec93bd5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8841522193794ea40a551f5fa87aaf15 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/ViewControllerBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class ViewControllerBase : SpotifyServiceListener 6 | { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2b659cdc1a14724abd69dee1f2c6a2e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Views.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7a5a7be435ee904d88de9861dbcad30 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Views/Landing View.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7d62427c72b01e42a2153ba7d4367bf 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Views/Search View.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 603cbe129fe1c694f9d3b11c9662cfe5 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets/Simple Artist Widget.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a06f1da413eb13a4caf68e7d60b7f894 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets/User Widget - UserID.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1255c066c19d964d91c945fcd50e6c1 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5956585f425fc2449c3337a530f0a59 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83b039a86f48f7f49a617b7fd902e096 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Search.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74ecfed5ede82b0449db802eb740baeb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Single Nav Playlist Item.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fcd1fdbbd83e2648bc755a955fc076f 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Single Playlist Track.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 388be8cfc6b1fdc4ca49ecbf152779d3 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Views/Liked Songs View.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d41f8f2c19a35548b91419c950d198b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Widgets/User Widget - Private User.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 393a1db7f36ae6f44bca897dc4c14e9f 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f063623956747b45a350aa978abc419 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Implicit Grant.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d69cd08e293568a469705ec5e7e2830f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Search/Search Single Track.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac1eeb3a0553a224aa4660b628936af8 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Spotify App/Views/Playlist Scroll View.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 897a4c4699d6c11428f4e61ed14623c8 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Client Credentials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2308f39c88c8f0841a01cd777436422b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /tools/wiki-tool/README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | Uses [Github WikiTo Converter](https://github.com/yakivmospan/github-wikito-converter) to pull the current [Wiki](https://github.com/JoshLmao/Spotify4Unity/wiki), *which should exist in the same directory as this*, and creates a local .html version of the Wiki -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_ActiveGreen.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ca095009a7b5614580999ff0106e437 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_Scrollbar.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40f857b0483e767429276d02448235f1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundBlack.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fba3e6b51796a2a4e90fb445049efd36 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundDark.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4df431b3a42156e4fb9b01a4bdceeb3b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundLight.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b89994dcc4d251448c2a01266cec3a0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Implicit Grant/ImplicitGrant_AuthConfig.cs: -------------------------------------------------------------------------------- 1 | /// 2 | /// Config for the implicit grant auth method 3 | /// There is nothing to change, sorry ;( 4 | /// 5 | public class ImplicitGrant_AuthConfig : AuthorizationConfig 6 | { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/ImplicitGrantConfigView.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | 3 | /// 4 | /// Editor view for the Implicit Grant auth config class 5 | /// 6 | [CustomEditor(typeof(ImplicitGrant_AuthConfig))] 7 | public class ImplicitGrantConfigView : AuthorizationConfigView 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/S4UUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e415c6e5b8608f428e25712fdc88611 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/SpotifyServiceView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 474e9798f9c4d754aa2328c67ecebfa8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Services/SpotifyService.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f89aa3cd9589e984391abe1cde2d76ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/LoadingSpinner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3ce54fb90e1c5142b1a3b4f556df80c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Unity/SpotifyPlayerListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 365efb7a61e1a544488f564e2e3782bd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Unity/SpotifyServiceListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41dc834d42589ef45aa6cceffe1a7c75 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/PKCEAuthConfigView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfc2f74c4437d1a49b8ac0e1def34c5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/AuthorizationConfigView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 966d619584f71f1499a9deb251c5d78b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/ImplicitGrantConfigView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29a83a47bc36143408182f01181a61bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Dependencies/UnitySingleton/SceneSingleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6109af759005fa647b9d7bc694d6122e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/ClientCredentialsConfigView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 245616e35cbfdb34a85e7ed508248799 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/AuthorizationConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e35b30bc0eb2ca40ab19f36bbb5e9e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/IServiceAuthenticator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 098770d1beda3cb4ba764ae71dbe62a7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_AuthConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 075e842a5527e274595cba51e52001c9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/UserWidgetController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9709dbe4fabc0f34d8723f62042737fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Spotify4Unity/Examples/Scenes/Spotify App.unity 10 | guid: 8e76123246cebb545917c7ce05bcfcab 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_Authentification.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04c2b3d8c3b36d54c84362261426ae5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/AccountStatusController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f34eebaf0da41fe439a11871d2916acc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/ArtistWidgetController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c12b618330d0f9498b6f1d850e0e6f9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/PlaylistWidgetController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0926d8637487274fb61cde247e832d6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/SinglePlaylistController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c406ae4e7b28ed242881e696b53cc96a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/AppMainContentController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 564e1455d77b57d4d886b84bae92125a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/SpotifyPlayerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6afe41a55ad2ffd4d90dd12515a9ce6c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/LandingViewController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a08b360ad476b94bac04e3f59fedb58 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/LikedSongsController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd7b97cb8cdec124cb392fd6bcd5299e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/SearchViewController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a67e9f5dd1ac1c4bab35002e44c9996 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/ViewControllerBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ad68b114f10fca46bb5e24873cc9d62 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Widgets/SingleArtistWidgetController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90418cf37eef7ca41a11f65f0fa08eee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/PlaylistsNavigationController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ce69f596be8af34791ca79c93e3d1d8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/PlaylistViewController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21d34c037ba10c84795cb6e58d0ad324 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SingleNavPlaylistController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95e82b5201b214b459ea40e33bd6acd7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SinglePlaylistSelectableTrack.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44d12ecedbe53e5418e71f001ba33495 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SingleSearchTrackController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3941dda64751fb44f82ce0b4d8b5d463 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Implicit Grant/ImplicitGrant_AuthConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed6d5acd6a942df4287194d5c8817e3b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Implicit Grant/ImplicitGrant_Authentification.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f4c650efb5adfa4ca42e87d242df9ea 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Client Credentials/ClientCredentials_AuthConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ab508c58bcd5cb43ba899a334629a2e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Client Credentials/ClientCredentials_Authentification.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ebccbd2a790bf045b6c6f3e86ff6156 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Client Credentials/ClientCredentials_AuthConfig.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [System.Serializable] 4 | public class ClientCredentials_AuthConfig : AuthorizationConfig 5 | { 6 | /// 7 | /// Secret Id of your app, can be located in your Spotify dashboard. Don't have one? Don't have an id? Go here: https://developer.spotify.com/dashboard/ 8 | /// 9 | public string ClientSecret = ""; 10 | } 11 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/LoadingSpinner.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class LoadingSpinner : MonoBehaviour 6 | { 7 | [Tooltip("How fast should the object rotate")] 8 | public float Speed = 1f; 9 | private void Update() 10 | { 11 | if (this.gameObject.activeInHierarchy) 12 | { 13 | this.transform.Rotate(new Vector3(0, 0, -1 * Speed)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tools/wiki-tool/GithubWiki2HTML.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo Updating Wiki repository 4 | 5 | rem Step into folder 6 | cd ".\Spotify4Unity.wiki" 7 | 8 | rem Pull git repo fore latest wiki 9 | git submodule update --init --recursive 10 | 11 | rem Go up a folder 12 | cd ".." 13 | 14 | rem Ask for version name 15 | set /p version="Enter Version: " 16 | 17 | echo Running GWTC to create Wiki file 18 | 19 | rem Convert wiki to html 20 | gwtc ".\Spotify4Unity.wiki" --file-name ".\Spotify4Unity.wiki\Spotify4Unity_v%version%_Documentation" -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: joshlmao 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: joshlmao 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: paypal.me/xjoshlmao -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Unity/SpotifyServiceListener.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Base class for listening to service specific events and overriding their callbacks 6 | /// 7 | public class SpotifyServiceListener : MonoBehaviour 8 | { 9 | protected virtual void Awake() 10 | { 11 | // Get instance and listen to connected event 12 | SpotifyService.Instance.OnClientConnectionChanged += OnSpotifyConnectionChanged; 13 | } 14 | 15 | protected virtual void OnSpotifyConnectionChanged(SpotifyClient client) 16 | { 17 | // Override me and take my client, i'll keep an ear out for any changes. 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Spotify4Unity/.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | 7 | # Visual Studio cache directory 8 | .vs/ 9 | 10 | # Autogenerated VS/MD/Consulo solution and project files 11 | ExportedObj/ 12 | .consulo/ 13 | *.csproj 14 | *.unityproj 15 | *.suo 16 | *.tmp 17 | *.user 18 | *.userprefs 19 | *.pidb 20 | *.booproj 21 | *.svd 22 | *.pdb 23 | *.opendb 24 | *.dll.mdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | *.pdb.meta 29 | *.dll.mdb.meta 30 | 31 | # Unity3D Generated File On Crash Reports 32 | sysinfo.txt 33 | 34 | # Builds 35 | *.apk 36 | *.unitypackage 37 | 38 | Assets/AssetStoreTools* 39 | Spotify4Unity/[Bb]in* 40 | Spotify4Unity/obj* 41 | 42 | PKCE-credentials.json 43 | 44 | /UserSettings/* -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/EmbedIO.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 566f134b7db682349a30da50764eac96 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/Swan.Lite.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a244c610420499940b49dd2ee00ace19 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f61f1f572b709b94f9bcf471f540f362 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Plugins/SpotifyAPI.Web.Auth.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fb6f036e8803324a8f7ab9adb1b66f6 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Dependencies/UnitySingleton/SceneSingleton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // https://answers.unity.com/questions/1408574/destroying-and-recreating-a-singleton.html 6 | public class SceneSingleton : MonoBehaviour where T : SceneSingleton 7 | { 8 | private static T m_Instance = null; 9 | public static T Instance 10 | { 11 | get 12 | { 13 | if (m_Instance == null) 14 | { 15 | m_Instance = FindObjectOfType(); 16 | // fallback, might not be necessary. 17 | if (m_Instance == null) 18 | m_Instance = new GameObject(typeof(T).Name).AddComponent(); 19 | DontDestroyOnLoad(m_Instance.gameObject); 20 | } 21 | return m_Instance; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/ClientCredentialsConfigView.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Editor view for the Client Credentials config 6 | /// 7 | [CustomEditor(typeof(ClientCredentials_AuthConfig))] 8 | public class ClientCredentialsConfigView : AuthorizationConfigView 9 | { 10 | private ClientCredentials_AuthConfig _ccConfig; 11 | 12 | protected override void OnEnable() 13 | { 14 | base.OnEnable(); 15 | 16 | _ccConfig = (ClientCredentials_AuthConfig)target; 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | base.OnInspectorGUI(); 22 | 23 | GUIContent content; 24 | 25 | // Client secret 26 | content = new GUIContent("Client Secret", "The client secret id of your app. Can be located in your Spotify dashboard."); 27 | _ccConfig.ClientSecret = EditorGUILayout.TextField(content, _ccConfig.ClientSecret); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Josh Shepherd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SingleNavPlaylistController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | public class SingleNavPlaylistController : MonoBehaviour 8 | { 9 | public event System.Action OnPlaylistSelected; 10 | 11 | [SerializeField] 12 | Button _selectPlaylistBtn; 13 | 14 | [SerializeField] 15 | Text _playlistNameText; 16 | 17 | private SimplePlaylist _playlist; 18 | 19 | private void Start() 20 | { 21 | } 22 | 23 | public void SetPlaylist(SimplePlaylist p) 24 | { 25 | _playlist = p; 26 | 27 | UpdateUI(); 28 | } 29 | 30 | private void UpdateUI() 31 | { 32 | if (_playlist != null) 33 | { 34 | if (_playlistNameText != null) 35 | { 36 | _playlistNameText.text = _playlist.Name; 37 | } 38 | if (_selectPlaylistBtn != null) 39 | { 40 | _selectPlaylistBtn.onClick.AddListener(() => OnPlaylistSelected?.Invoke(_playlist)); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/IServiceAuthenticator.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | 4 | /// 5 | /// Interface for providing authentication to a Spotify4Unity Spotify Service 6 | /// 7 | public interface IServiceAuthenticator 8 | { 9 | // Triggered when authentification has been successfully loaded or retrieved from the user 10 | public event Action OnAuthenticatorComplete; 11 | 12 | 13 | // Configures the authenticator with it's own custom config class 14 | void Configure(object config); 15 | 16 | // Check if previous authentification exists and loads into memory 17 | bool HasPreviousAuthentification(); 18 | 19 | // Gets new authentification from this auth method. Either prompts user if no previous or init's the SpotifyAPI.Web.IAuthenticator 20 | void StartAuthentification(); 21 | // Deauthorizes the current user, removing any auth in memory. 22 | void DeauthorizeUser(); 23 | // Removes any previous authentification, either in memory or on system 24 | void RemoveSavedAuth(); 25 | 26 | // Gets the DateTime of when the authorization will expire 27 | DateTime GetExpiryDateTime(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/LandingViewController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | public class LandingViewController : ViewControllerBase 8 | { 9 | [SerializeField] 10 | private GameObject _freeUserWarningParent; 11 | 12 | private List _dispatcher = new List(); 13 | 14 | private void Start() 15 | { 16 | if (_freeUserWarningParent != null) 17 | { 18 | _freeUserWarningParent.SetActive(false); 19 | } 20 | } 21 | 22 | private void Update() 23 | { 24 | if (_dispatcher.Count > 0) 25 | { 26 | foreach (Action actn in _dispatcher) 27 | actn.Invoke(); 28 | 29 | _dispatcher.Clear(); 30 | } 31 | } 32 | 33 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 34 | { 35 | base.OnSpotifyConnectionChanged(client); 36 | 37 | if (client != null) 38 | { 39 | bool isPremium = await S4UUtility.IsUserPremium(client); 40 | _dispatcher.Add(() => 41 | { 42 | _freeUserWarningParent.SetActive(!isPremium); 43 | }); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/AuthorizationConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Base configurable variables for authorization methods 6 | /// 7 | [System.Serializable] 8 | public class AuthorizationConfig : MonoBehaviour 9 | { 10 | /// 11 | /// Your client id, found in your Spotify Dashboard. Don't have an id? Go here: https://developer.spotify.com/dashboard/ 12 | /// 13 | public string ClientID = ""; 14 | 15 | /// 16 | /// All API scopes required for your functionality. By default, all scopes will be selected. 17 | /// You should only select the scopes you aim to use in your app. Users are more likely to accept authorization the less API scopes you use 18 | /// 19 | public List APIScopes = S4UUtility.GetAllScopes(); 20 | 21 | /// 22 | /// The redirect uri used to pass Spotify authentification onto your app. This uri needs to be in your Spotify Dashboard. Dont change this if you don't know what you are doing. 23 | /// 24 | public string RedirectUri = "http://localhost:5000/callback"; 25 | 26 | /// 27 | /// Port number to use for recieving Spotify auth from the browser. Should be the same value in your Redirect uri 28 | /// Don't change this if you don't know what you are doing 29 | /// 30 | public int ServerPort = 5000; 31 | } 32 | -------------------------------------------------------------------------------- /Spotify4Unity/Spotify4Unity.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{EE0707C1-80C5-490B-B2DA-D0AFD656C500}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{FA30D7D8-0C5E-2DBE-995A-0FA31246D277}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {EE0707C1-80C5-490B-B2DA-D0AFD656C500}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {EE0707C1-80C5-490B-B2DA-D0AFD656C500}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {EE0707C1-80C5-490B-B2DA-D0AFD656C500}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {EE0707C1-80C5-490B-B2DA-D0AFD656C500}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {FA30D7D8-0C5E-2DBE-995A-0FA31246D277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {FA30D7D8-0C5E-2DBE-995A-0FA31246D277}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {FA30D7D8-0C5E-2DBE-995A-0FA31246D277}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {FA30D7D8-0C5E-2DBE-995A-0FA31246D277}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/PKCE/PKCE_AuthConfig.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// 4 | /// Enum containing all method types used to save PKCE authentification 5 | /// 6 | public enum PKCETokenSaveType 7 | { 8 | File = 0, 9 | PlayerPrefs = 1, 10 | } 11 | 12 | /// 13 | /// All configurable parameters for the PKCE authorization method 14 | /// 15 | [System.Serializable] 16 | public class PKCE_AuthConfig : AuthorizationConfig 17 | { 18 | /// 19 | /// Length of the automatically generated verifier string. Value defaults to 100, only change if you know what you're doing 20 | /// 21 | public int Length = 100; 22 | /// 23 | /// Your own custom verifier string. If this is set, it takes priority over the length. Value defaults to empty, only change if you know what you're doing 24 | /// 25 | public string Verifier = ""; 26 | 27 | /// 28 | /// Method to use for saving PKCE token. 29 | /// 30 | public PKCETokenSaveType TokenSaveType; 31 | /// 32 | /// If TokenSaveType is File, use this local path to store the PKCE authorization token 33 | /// 34 | public string TokenPath = "PKCE-credentials.json"; 35 | /// 36 | /// If TokenSaveType is PlayerPrefs, store the current credentials in player preferences using this key 37 | /// 38 | public string PlayerPrefsKey = "PKCE-credentials"; 39 | } 40 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Client Credentials/ClientCredentials_Authentification.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using UnityEngine; 4 | 5 | public class ClientCredentials_Authorization : MonoBehaviour, IServiceAuthenticator 6 | { 7 | public event Action OnAuthenticatorComplete; 8 | 9 | private ClientCredentials_AuthConfig _authConfig; 10 | 11 | private ClientCredentialsTokenResponse _token; 12 | 13 | private IAuthenticator _ccAuthenticator; 14 | 15 | public void Configure(object config) 16 | { 17 | if (config is ClientCredentials_AuthConfig ccConfig) 18 | { 19 | _authConfig = ccConfig; 20 | } 21 | } 22 | 23 | public bool HasPreviousAuthentification() 24 | { 25 | return false; 26 | } 27 | 28 | public void StartAuthentification() 29 | { 30 | // Create CC authenticator to manage auth 31 | _ccAuthenticator = new ClientCredentialsAuthenticator(_authConfig.ClientID, _authConfig.ClientSecret); 32 | 33 | // Trigger complete 34 | OnAuthenticatorComplete?.Invoke(_ccAuthenticator); 35 | } 36 | 37 | public void RemoveSavedAuth() 38 | { 39 | // No saved auth, not valid 40 | } 41 | 42 | public DateTime GetExpiryDateTime() 43 | { 44 | if (_ccAuthenticator != null && _ccAuthenticator is ClientCredentialsAuthenticator ccAuthenticator) 45 | { 46 | return S4UUtility.GetTokenExpiry(ccAuthenticator.Token.CreatedAt, ccAuthenticator.Token.ExpiresIn); 47 | } 48 | return DateTime.MinValue; 49 | } 50 | 51 | public void DeauthorizeUser() 52 | { 53 | if (_ccAuthenticator != null) 54 | { 55 | _ccAuthenticator = null; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SingleSearchTrackController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class SingleSearchTrackController : MonoBehaviour 7 | { 8 | [SerializeField] 9 | private Text _name, _artist, _duration; 10 | 11 | [SerializeField] 12 | private Button _playBtn; 13 | 14 | private FullTrack _track; 15 | 16 | public void SetTrack(FullTrack t) 17 | { 18 | _track = t; 19 | 20 | UpdateUI(); 21 | } 22 | 23 | private void UpdateUI() 24 | { 25 | if (_name != null) 26 | { 27 | _name.text = _track.Name; 28 | } 29 | if (_artist != null) 30 | { 31 | _artist.text = S4UUtility.ArtistsToSeparatedString(", ", _track.Artists); 32 | } 33 | if (_duration != null) 34 | { 35 | _duration.text = S4UUtility.MsToTimeString(_track.DurationMs); 36 | } 37 | if (_playBtn != null) 38 | { 39 | _playBtn.onClick.AddListener(() => 40 | { 41 | var client = SpotifyService.Instance.GetSpotifyClient(); 42 | if (client != null) 43 | { 44 | PlayerResumePlaybackRequest request = new PlayerResumePlaybackRequest() 45 | { 46 | //ContextUri = , // Play within context of just the individual track 47 | Uris = new List() { _track.Uri }, 48 | }; 49 | client.Player.ResumePlayback(request); 50 | 51 | Debug.Log($"Spotify App | Playing searched song '{S4UUtility.ArtistsToSeparatedString(", ", _track.Artists)} - {_track.Name}'"); 52 | } 53 | }); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Spotify4Unity/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.5.7", 4 | "com.unity.ide.rider": "3.0.6", 5 | "com.unity.ide.visualstudio": "2.0.8", 6 | "com.unity.ide.vscode": "1.2.3", 7 | "com.unity.test-framework": "1.1.24", 8 | "com.unity.textmeshpro": "3.0.6", 9 | "com.unity.timeline": "1.5.5", 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.modules.ai": "1.0.0", 12 | "com.unity.modules.androidjni": "1.0.0", 13 | "com.unity.modules.animation": "1.0.0", 14 | "com.unity.modules.assetbundle": "1.0.0", 15 | "com.unity.modules.audio": "1.0.0", 16 | "com.unity.modules.cloth": "1.0.0", 17 | "com.unity.modules.director": "1.0.0", 18 | "com.unity.modules.imageconversion": "1.0.0", 19 | "com.unity.modules.imgui": "1.0.0", 20 | "com.unity.modules.jsonserialize": "1.0.0", 21 | "com.unity.modules.particlesystem": "1.0.0", 22 | "com.unity.modules.physics": "1.0.0", 23 | "com.unity.modules.physics2d": "1.0.0", 24 | "com.unity.modules.screencapture": "1.0.0", 25 | "com.unity.modules.terrain": "1.0.0", 26 | "com.unity.modules.terrainphysics": "1.0.0", 27 | "com.unity.modules.tilemap": "1.0.0", 28 | "com.unity.modules.ui": "1.0.0", 29 | "com.unity.modules.uielements": "1.0.0", 30 | "com.unity.modules.umbra": "1.0.0", 31 | "com.unity.modules.unityanalytics": "1.0.0", 32 | "com.unity.modules.unitywebrequest": "1.0.0", 33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 34 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 35 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 36 | "com.unity.modules.unitywebrequestwww": "1.0.0", 37 | "com.unity.modules.vehicles": "1.0.0", 38 | "com.unity.modules.video": "1.0.0", 39 | "com.unity.modules.vr": "1.0.0", 40 | "com.unity.modules.wind": "1.0.0", 41 | "com.unity.modules.xr": "1.0.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/SpotifyServiceView.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Editor view for the main Spotify Service 6 | /// 7 | [CustomEditor(typeof(SpotifyService))] 8 | public class SpotifyServiceEditor : Editor 9 | { 10 | private SpotifyService _service; 11 | 12 | private void OnEnable() 13 | { 14 | _service = (SpotifyService)target; 15 | } 16 | 17 | public override void OnInspectorGUI() 18 | { 19 | EditorGUILayout.Space(); 20 | 21 | GUILayout.BeginHorizontal(); 22 | if (GUILayout.Button("Open Spotify4Unity Repo")) 23 | Application.OpenURL("https://github.com/JoshLmao/Spotify4Unity/"); 24 | if (GUILayout.Button("Open Spotify Dashboard")) 25 | Application.OpenURL("https://developer.spotify.com/dashboard/"); 26 | GUILayout.EndHorizontal(); 27 | 28 | EditorGUILayout.Space(); 29 | 30 | EditorGUILayout.LabelField("Spotify Service Options", EditorStyles.boldLabel); 31 | 32 | GUIContent content; 33 | 34 | content = new GUIContent("Authorize On Start", "Should the service authorize the user on Start(). If disabled, service will not start until you call SpotifyService.StartService()"); 35 | _service.AuthorizeUserOnStart = EditorGUILayout.Toggle(content, _service.AuthorizeUserOnStart); 36 | 37 | content = new GUIContent("Authentification Type", "Which method of authentification to use with the service."); 38 | _service.AuthType = (AuthenticationType)EditorGUILayout.EnumPopup(content, _service.AuthType); 39 | 40 | // Validate if a config file is next to service, display warning if not 41 | GameObject selectedGO = Selection.activeGameObject; 42 | if (selectedGO != null) 43 | { 44 | if (selectedGO.GetComponent() == null) 45 | { 46 | EditorGUILayout.HelpBox("Add the correct configuration component next to this service! The component's name ends with '_AuthConfig'", MessageType.Warning); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spotify4Unity 2 | 3 |

4 | 5 | twitter 6 | 7 | 8 | releases 9 | 10 | 11 | releases 12 | 13 | 14 | releases 15 | 16 |

17 | 18 | ## About 19 | 20 | Spotify4Unity helps to add [JohnnyCrazy's](https://github.com/JohnnyCrazy) [SpotifyAPI.NET](https://github.com/JohnnyCrazy/SpotifyAPI-NET) library into Unity. The package comes with a central ```SpotifyService``` which is designed to act as a medium between Unity and Spotify. The package also comes with an example Spotify App built from the ground up using Unity UI and the Spotify4Unity service. For more information, check out the [Examples](#examples) section 21 | 22 | Spotify4Unity v2.0 currently only supports Windows, Linux and Mac 23 | 24 | ![spotify-4-unity-preview.png](https://user-images.githubusercontent.com/22716832/123115027-b03cda80-d437-11eb-93b7-964a49ed211e.png) 25 | 26 | ## Installation 27 | 28 | ### UnityPackage 29 | 30 | 1. Download the latest Spotify4Unity.unitypackage from the [releases section](https://github.com/joshlmao/spotify4unity/releases/) 31 | 2. Double click to import it into your Unity 32 | 33 | ## Get Started 34 | 35 | Take a look at the [Wiki](https://github.com/JoshLmao/spotify4unity/wiki/), which is *smaller* and contains vital information on how to use the package. 36 | 37 | ## Issues 38 | 39 | If you have any problems, feel free to open an [issue](https://github.com/joshlmao/spotify4unity/issues/) with your problem. Please supply as much detail as possible 40 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/AccountStatusController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using UnityEngine.UI; 7 | 8 | /// 9 | /// Simple controller script for signing in/out of Spotify using S4U 10 | /// This is an example script of how/what you could/should implement 11 | /// 12 | public class AccountStatusController : SpotifyServiceListener 13 | { 14 | public bool ServiceAuthOnStart = false; 15 | 16 | [SerializeField] 17 | private Button _signInButton, _signOutButton; 18 | 19 | private void Start() 20 | { 21 | SpotifyService.Instance.AuthorizeUserOnStart = ServiceAuthOnStart; 22 | 23 | if (_signInButton != null) 24 | { 25 | _signInButton.onClick.AddListener(() => this.OnSignIn()); 26 | } 27 | if (_signOutButton != null) 28 | { 29 | _signOutButton.onClick.AddListener(() => this.OnSignOut()); 30 | } 31 | 32 | if (!ServiceAuthOnStart) 33 | { 34 | _signInButton.gameObject.SetActive(true); 35 | _signOutButton.gameObject.SetActive(false); 36 | } 37 | } 38 | 39 | private void OnSignIn() 40 | { 41 | SpotifyService service = SpotifyService.Instance; 42 | 43 | if (!service.IsConnected) 44 | { 45 | service.AuthorizeUser(); 46 | } 47 | else 48 | { 49 | Debug.LogError("Can't sign in. Already connected"); 50 | } 51 | } 52 | 53 | private void OnSignOut() 54 | { 55 | SpotifyService service = SpotifyService.Instance; 56 | if (service.IsConnected) 57 | { 58 | service.DeauthorizeUser(); 59 | } 60 | } 61 | 62 | protected override void OnSpotifyConnectionChanged(SpotifyClient client) 63 | { 64 | base.OnSpotifyConnectionChanged(client); 65 | 66 | bool isConnected = client != null; 67 | _signInButton.gameObject.SetActive(!isConnected); 68 | _signOutButton.gameObject.SetActive(isConnected); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/SinglePlaylistController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using System.Linq; 7 | 8 | public class SinglePlaylistController : MonoBehaviour 9 | { 10 | [SerializeField] 11 | private UnityEngine.UI.Image _icon; 12 | 13 | [SerializeField] 14 | private Text _nameText, _creatorText; 15 | 16 | [SerializeField] 17 | private Button _playPlaylistBtn; 18 | 19 | private SimplePlaylist _playlist; 20 | 21 | public void SetPlaylist(SimplePlaylist playlist) 22 | { 23 | _playlist = playlist; 24 | 25 | UpdateUI(); 26 | } 27 | 28 | private void UpdateUI() 29 | { 30 | if (_playlist != null) 31 | { 32 | if (_nameText != null) 33 | { 34 | _nameText.text = _playlist.Name; 35 | } 36 | 37 | if (_creatorText != null) 38 | { 39 | _creatorText.text = "By " + _playlist.Owner.DisplayName; 40 | } 41 | 42 | if (_icon != null) 43 | { 44 | SpotifyAPI.Web.Image image = S4UUtility.GetLowestResolutionImage(_playlist.Images); 45 | if(image != null) 46 | { 47 | StartCoroutine(S4UUtility.LoadImageFromUrl(image.Url, (loadedSprite) => 48 | { 49 | _icon.sprite = loadedSprite; 50 | })); 51 | } 52 | } 53 | 54 | if (_playPlaylistBtn != null) 55 | { 56 | _playPlaylistBtn.onClick.AddListener(() => 57 | { 58 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 59 | 60 | PlayerResumePlaybackRequest request = new PlayerResumePlaybackRequest 61 | { 62 | ContextUri = _playlist.Uri 63 | }; 64 | client.Player.ResumePlayback(request); 65 | }); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/PKCEAuthConfigView.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | /// 5 | /// Editor view for the PKCE config class 6 | /// 7 | [CustomEditor(typeof(PKCE_AuthConfig))] 8 | public class PKCEAuthConfigView : AuthorizationConfigView 9 | { 10 | private PKCE_AuthConfig _pkceConfig; 11 | 12 | protected override void OnEnable() 13 | { 14 | base.OnEnable(); 15 | 16 | _pkceConfig = (PKCE_AuthConfig)target; 17 | } 18 | 19 | public override void OnInspectorGUI() 20 | { 21 | base.OnInspectorGUI(); 22 | 23 | GUIContent content; 24 | 25 | // Title 26 | EditorGUILayout.LabelField("PKCE Config", EditorStyles.boldLabel); 27 | 28 | // PKCE codes length 29 | content = new GUIContent("Custom Length", "Length of the automatically generated verifier string. Value defaults to 100, only change if you know what you're doing"); 30 | _pkceConfig.Length = EditorGUILayout.IntField(content, _pkceConfig.Length); 31 | 32 | // PKCE codes verifier 33 | content = new GUIContent("Custom Verifier", "Your own custom verifier string. If this is set, it takes priority over the length. Value defaults to empty, only change if you know what you're doing"); 34 | _pkceConfig.Verifier = EditorGUILayout.TextField(content, _pkceConfig.Verifier); 35 | 36 | EditorGUILayout.Space(); 37 | 38 | // Save type 39 | content = new GUIContent("Token Save Type", "Method to use for saving and reusing the PKCE token"); 40 | _pkceConfig.TokenSaveType = (PKCETokenSaveType)EditorGUILayout.EnumPopup(content, _pkceConfig.TokenSaveType); 41 | 42 | // Display only TokenPath or PlayerPrefsKey UI depending on TokenSaveType 43 | if (_pkceConfig.TokenSaveType == PKCETokenSaveType.File) 44 | { 45 | // File Path 46 | content = new GUIContent("Local File Path", "If TokenSaveType is File, use this local path to store the PKCE authorization token"); 47 | _pkceConfig.TokenPath = EditorGUILayout.TextField(content, _pkceConfig.TokenPath); 48 | } 49 | else if (_pkceConfig.TokenSaveType == PKCETokenSaveType.PlayerPrefs) 50 | { 51 | // PlayerPrefs key 52 | content = new GUIContent("Player Preferences Key", "If TokenSaveType is PlayerPrefs, store the current credentials in player preferences using this key"); 53 | _pkceConfig.PlayerPrefsKey = EditorGUILayout.TextField(content, _pkceConfig.PlayerPrefsKey); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundBlack.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpotifyPallet_BackgroundBlack 11 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Ints: [] 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _ColorMask: 15 62 | - _Cutoff: 0.5 63 | - _DetailNormalMapScale: 1 64 | - _DstBlend: 0 65 | - _GlossMapScale: 1 66 | - _Glossiness: 0.5 67 | - _GlossyReflections: 1 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _SmoothnessTextureChannel: 0 73 | - _SpecularHighlights: 1 74 | - _SrcBlend: 1 75 | - _Stencil: 0 76 | - _StencilComp: 8 77 | - _StencilOp: 0 78 | - _StencilReadMask: 255 79 | - _StencilWriteMask: 255 80 | - _UVSec: 0 81 | - _UseUIAlphaClip: 0 82 | - _ZWrite: 1 83 | m_Colors: 84 | - _Color: {r: 0, g: 0, b: 0, a: 1} 85 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_Scrollbar.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpotifyPallet_Scrollbar 11 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Ints: [] 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _ColorMask: 15 62 | - _Cutoff: 0.5 63 | - _DetailNormalMapScale: 1 64 | - _DstBlend: 0 65 | - _GlossMapScale: 1 66 | - _Glossiness: 0.5 67 | - _GlossyReflections: 1 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _SmoothnessTextureChannel: 0 73 | - _SpecularHighlights: 1 74 | - _SrcBlend: 1 75 | - _Stencil: 0 76 | - _StencilComp: 8 77 | - _StencilOp: 0 78 | - _StencilReadMask: 255 79 | - _StencilWriteMask: 255 80 | - _UVSec: 0 81 | - _UseUIAlphaClip: 0 82 | - _ZWrite: 1 83 | m_Colors: 84 | - _Color: {r: 0.3019608, g: 0.3019608, b: 0.3019608, a: 1} 85 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_ActiveGreen.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpotifyPallet_ActiveGreen 11 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Ints: [] 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _ColorMask: 15 62 | - _Cutoff: 0.5 63 | - _DetailNormalMapScale: 1 64 | - _DstBlend: 0 65 | - _GlossMapScale: 1 66 | - _Glossiness: 0.5 67 | - _GlossyReflections: 1 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _SmoothnessTextureChannel: 0 73 | - _SpecularHighlights: 1 74 | - _SrcBlend: 1 75 | - _Stencil: 0 76 | - _StencilComp: 8 77 | - _StencilOp: 0 78 | - _StencilReadMask: 255 79 | - _StencilWriteMask: 255 80 | - _UVSec: 0 81 | - _UseUIAlphaClip: 0 82 | - _ZWrite: 1 83 | m_Colors: 84 | - _Color: {r: 0.11372549, g: 0.7254902, b: 0.32941177, a: 1} 85 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundDark.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpotifyPallet_BackgroundDark 11 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Ints: [] 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _ColorMask: 15 62 | - _Cutoff: 0.5 63 | - _DetailNormalMapScale: 1 64 | - _DstBlend: 0 65 | - _GlossMapScale: 1 66 | - _Glossiness: 0.5 67 | - _GlossyReflections: 1 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _SmoothnessTextureChannel: 0 73 | - _SpecularHighlights: 1 74 | - _SrcBlend: 1 75 | - _Stencil: 0 76 | - _StencilComp: 8 77 | - _StencilOp: 0 78 | - _StencilReadMask: 255 79 | - _StencilWriteMask: 255 80 | - _UVSec: 0 81 | - _UseUIAlphaClip: 0 82 | - _ZWrite: 1 83 | m_Colors: 84 | - _Color: {r: 0.07058824, g: 0.07058824, b: 0.07058824, a: 1} 85 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Materials/SpotifyPallet_BackgroundLight.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: SpotifyPallet_BackgroundLight 11 | m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Ints: [] 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _ColorMask: 15 62 | - _Cutoff: 0.5 63 | - _DetailNormalMapScale: 1 64 | - _DstBlend: 0 65 | - _GlossMapScale: 1 66 | - _Glossiness: 0.5 67 | - _GlossyReflections: 1 68 | - _Metallic: 0 69 | - _Mode: 0 70 | - _OcclusionStrength: 1 71 | - _Parallax: 0.02 72 | - _SmoothnessTextureChannel: 0 73 | - _SpecularHighlights: 1 74 | - _SrcBlend: 1 75 | - _Stencil: 0 76 | - _StencilComp: 8 77 | - _StencilOp: 0 78 | - _StencilReadMask: 255 79 | - _StencilWriteMask: 255 80 | - _UVSec: 0 81 | - _UseUIAlphaClip: 0 82 | - _ZWrite: 1 83 | m_Colors: 84 | - _Color: {r: 0.09411765, g: 0.09411765, b: 0.09411765, a: 1} 85 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 86 | m_BuildTextureStacks: [] 87 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/AppMainContentController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using Object = UnityEngine.Object; 6 | 7 | [Serializable] 8 | public enum Views 9 | { 10 | Landing = 0, 11 | Playlist = 1, 12 | Search = 2, 13 | LikedSongs = 3, 14 | } 15 | 16 | public class AppMainContentController : MonoBehaviour 17 | { 18 | /// 19 | /// All prefabs for every view. Need to be ordered by their number in Views enum 20 | /// 21 | public List ViewPrefabs; 22 | 23 | // Parent the views should be children of 24 | [SerializeField] 25 | private Transform _viewsParent; 26 | 27 | // Current view's controller 28 | private ViewControllerBase _currentViewController; 29 | 30 | private void Start() 31 | { 32 | // Destroy any initial children 33 | if (_viewsParent.transform.childCount > 0) 34 | { 35 | foreach(Transform child in _viewsParent.transform) 36 | { 37 | Destroy(child.gameObject); 38 | } 39 | } 40 | 41 | // Set default view 42 | SetViewFromEnum(Views.Landing); 43 | } 44 | 45 | public void SetContent(object expectedObject) 46 | { 47 | if (expectedObject is SimplePlaylist playlist) 48 | { 49 | MonoBehaviour viewController = SetViewFromEnum(Views.Playlist, (view) => 50 | { 51 | (view as PlaylistViewController).SetPlaylist(playlist); 52 | }); 53 | } 54 | else if (expectedObject is Views setView) 55 | { 56 | SetViewFromEnum(setView, null); 57 | } 58 | else 59 | { 60 | // Else if unknonwn object or null, display home screen 61 | SetViewFromEnum(Views.Landing); 62 | } 63 | } 64 | 65 | private MonoBehaviour SetViewFromEnum(Views viewEnum, Action intermediateActn = null) 66 | { 67 | if (_currentViewController != null) 68 | { 69 | Destroy(_currentViewController.gameObject); 70 | _currentViewController = null; 71 | } 72 | 73 | GameObject prefab = ViewPrefabs[(int)viewEnum]; 74 | if (prefab) 75 | { 76 | // Set main view to playlist 77 | GameObject viewGO = Instantiate(prefab, _viewsParent); 78 | 79 | // Get view controller base, invoke any action 80 | _currentViewController = viewGO.GetComponent(); 81 | if (!_currentViewController) 82 | { 83 | Debug.LogError($"View '{viewEnum}' doesn't inherit from ViewControllerBase!"); 84 | } 85 | intermediateActn?.Invoke(_currentViewController); 86 | 87 | return _currentViewController; 88 | } 89 | 90 | return null; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/heart-icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60206f69a6be1c14799527eebea21f58 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/home-icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d4b9ecbea93f2945993a744e9dfabb4 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-pause.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c3093d4a36e9074a94551e11146e256 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-play.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 465b36d1c47d06e479df037e8ff343de 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/search-icon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84b720939e7fdaa4abe6e40b610d04a1 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-max.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68f5c4ebe0237c349a0c2b6e98adf491 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/volume-mute.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ea959369921f14d954a910e5ec1228 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/LoadingSpinner.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5f4a32936bf82a4fbba41ea66235744 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-shuffle.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa1d3d2e0e91f84429a3ea9d12c4213d 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-repeat-none.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b44af079815c817458e1b199653cdcb0 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-backward.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f09402f654447f348a227b8c1bc0e9f7 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/media-step-forward.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34f60eedc8027514c960534440f0a468 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | bones: [] 96 | spriteID: 5e97eb03825dee720800000000000000 97 | internalID: 0 98 | vertices: [] 99 | indices: 100 | edges: [] 101 | weights: [] 102 | secondaryTextures: [] 103 | spritePackingTag: 104 | pSDRemoveMatte: 0 105 | pSDShowRemoveMatteOption: 0 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Core/Managed Authentification/Implicit Grant/ImplicitGrant_Authentification.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using SpotifyAPI.Web.Auth; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Threading.Tasks; 7 | using UnityEngine; 8 | 9 | public class ImplicitGrant_Authentification : MonoBehaviour, IServiceAuthenticator 10 | { 11 | public event Action OnAuthenticatorComplete; 12 | 13 | // Current config for method 14 | private AuthorizationConfig _authConfig; 15 | 16 | // Last gained auth token 17 | private ImplictGrantResponse _lastAuthToken; 18 | 19 | // Server for local callback 20 | private static EmbedIOAuthServer _server; 21 | 22 | public void Configure(object config) 23 | { 24 | if (config is AuthorizationConfig authConfig) 25 | { 26 | _authConfig = authConfig; 27 | } 28 | } 29 | 30 | public bool HasPreviousAuthentification() 31 | { 32 | // Never has previous authentification. 33 | // Implicit grant requires user auth every time. 34 | return false; 35 | } 36 | 37 | public async void StartAuthentification() 38 | { 39 | // Validate config values 40 | if (_authConfig.RedirectUri == string.Empty && _authConfig.ServerPort <= 0) 41 | { 42 | // Problem with user's config, use default values 43 | _authConfig.RedirectUri = "http://localhost:5000/callback"; 44 | _authConfig.ServerPort = 5000; 45 | return; 46 | } 47 | 48 | // Start server 49 | _server = new EmbedIOAuthServer(new Uri(_authConfig.RedirectUri), _authConfig.ServerPort); 50 | await _server.Start(); 51 | 52 | // Await token recieved 53 | _server.ImplictGrantReceived += this.OnImplicitGrantReceived; 54 | 55 | // Create request 56 | LoginRequest request = new LoginRequest(_server.BaseUri, _authConfig.ClientID, LoginRequest.ResponseType.Token) 57 | { 58 | Scope = _authConfig.APIScopes, 59 | }; 60 | BrowserUtil.Open(request.ToUri()); 61 | } 62 | 63 | private async Task OnImplicitGrantReceived(object sender, ImplictGrantResponse response) 64 | { 65 | // Stop server 66 | await _server.Stop(); 67 | 68 | _lastAuthToken = response; 69 | 70 | // Trigger complete with auth token 71 | OnAuthenticatorComplete?.Invoke(_lastAuthToken); 72 | } 73 | 74 | public void RemoveSavedAuth() 75 | { 76 | // N/A 77 | } 78 | 79 | public DateTime GetExpiryDateTime() 80 | { 81 | if (_lastAuthToken != null) 82 | { 83 | return S4UUtility.GetTokenExpiry(_lastAuthToken.CreatedAt, _lastAuthToken.ExpiresIn); 84 | } 85 | return DateTime.MinValue; 86 | } 87 | 88 | public void DeauthorizeUser() 89 | { 90 | if (_server != null) 91 | { 92 | _server.Dispose(); 93 | } 94 | 95 | if (_lastAuthToken != null) 96 | { 97 | _lastAuthToken = null; 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Images/UI/user-follow.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5216e59271026554fa8561e96dd12d0e 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 1 39 | wrapV: 1 40 | wrapW: 0 41 | nPOTScale: 0 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 1 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 1 54 | spriteTessellationDetail: -1 55 | textureType: 8 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | - serializedVersion: 3 79 | buildTarget: Standalone 80 | maxTextureSize: 2048 81 | resizeAlgorithm: 0 82 | textureFormat: -1 83 | textureCompression: 1 84 | compressionQuality: 50 85 | crunchedCompression: 0 86 | allowsAlphaSplitting: 0 87 | overridden: 0 88 | androidETC2FallbackOverride: 0 89 | forceMaximumCompressionQuality_BC6H_BC7: 0 90 | - serializedVersion: 3 91 | buildTarget: Android 92 | maxTextureSize: 2048 93 | resizeAlgorithm: 0 94 | textureFormat: -1 95 | textureCompression: 1 96 | compressionQuality: 50 97 | crunchedCompression: 0 98 | allowsAlphaSplitting: 0 99 | overridden: 0 100 | androidETC2FallbackOverride: 0 101 | forceMaximumCompressionQuality_BC6H_BC7: 0 102 | spriteSheet: 103 | serializedVersion: 2 104 | sprites: [] 105 | outline: [] 106 | physicsShape: [] 107 | bones: [] 108 | spriteID: 5e97eb03825dee720800000000000000 109 | internalID: 0 110 | vertices: [] 111 | indices: 112 | edges: [] 113 | weights: [] 114 | secondaryTextures: [] 115 | spritePackingTag: 116 | pSDRemoveMatte: 0 117 | pSDShowRemoveMatteOption: 0 118 | userData: 119 | assetBundleName: 120 | assetBundleVariant: 121 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Prefabs/SinglePlaylistSelectableTrack.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Threading.Tasks; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | public class SinglePlaylistSelectableTrack : MonoBehaviour 10 | { 11 | [SerializeField] 12 | Button _playTrackBtn; 13 | 14 | [SerializeField] 15 | Text _trackNameText, _trackArtistsText, _albumText, _durationText; 16 | 17 | [SerializeField] 18 | Button _addToQueueBtn; 19 | 20 | private string _contextUri; 21 | private FullTrack _track; 22 | 23 | private void Start() 24 | { 25 | // Add btn listeners on start 26 | if (_playTrackBtn != null) 27 | { 28 | _playTrackBtn.onClick.AddListener(this.OnPlayTrack); 29 | } 30 | 31 | if (_addToQueueBtn != null) 32 | { 33 | _addToQueueBtn.onClick.AddListener(this.OnAddToQueue); 34 | } 35 | } 36 | 37 | public void SetTrack(FullTrack t, string contextUri) 38 | { 39 | _contextUri = contextUri; 40 | // Set track and Update 41 | _track = t; 42 | 43 | UpdateUI(); 44 | } 45 | 46 | private void UpdateUI() 47 | { 48 | if (_track != null) 49 | { 50 | if (_trackNameText != null) 51 | { 52 | _trackNameText.text = _track.Name; 53 | } 54 | if (_trackArtistsText != null) 55 | { 56 | _trackArtistsText.text = S4UUtility.ArtistsToSeparatedString(", ", _track.Artists); 57 | } 58 | if (_albumText != null) 59 | { 60 | _albumText.text = _track.Album.Name; 61 | } 62 | if (_durationText != null) 63 | { 64 | _durationText.text = S4UUtility.MsToTimeString(_track.DurationMs); 65 | } 66 | } 67 | } 68 | 69 | private async void OnPlayTrack() 70 | { 71 | if (_track != null) 72 | { 73 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 74 | if (client != null) 75 | { 76 | // Play track in context of the playlist 77 | PlayerResumePlaybackRequest request = new PlayerResumePlaybackRequest() 78 | { 79 | ContextUri = _contextUri, 80 | OffsetParam = new PlayerResumePlaybackRequest.Offset() { Uri = _track.Uri }, 81 | }; 82 | await client.Player.ResumePlayback(request); 83 | 84 | LogTrackChange("Playing track"); 85 | } 86 | } 87 | } 88 | 89 | 90 | private void OnAddToQueue() 91 | { 92 | if (_track != null) 93 | { 94 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 95 | if (client != null) 96 | { 97 | PlayerAddToQueueRequest request = new PlayerAddToQueueRequest(_track.Uri); 98 | client.Player.AddToQueue(request); 99 | 100 | LogTrackChange("Added to queue"); 101 | } 102 | } 103 | } 104 | 105 | private void LogTrackChange(string source) 106 | { 107 | Debug.Log($"Spotify App | {source} '{S4UUtility.ArtistsToSeparatedString(", ", _track.Artists)} - {_track.Name}'"); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/PlaylistWidgetController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | public class PlaylistWidgetController : SpotifyServiceListener 8 | { 9 | [SerializeField] 10 | private GameObject _playlistPrefab; 11 | 12 | [SerializeField] 13 | private Transform _listViewParent; 14 | 15 | private IEnumerable _allPlaylists = null; 16 | bool _isPopulated = false; 17 | 18 | private void Update() 19 | { 20 | if (_allPlaylists != null && _allPlaylists.Count() > 0 && !_isPopulated) 21 | { 22 | PopulateListUI(); 23 | _isPopulated = true; 24 | } 25 | } 26 | 27 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 28 | { 29 | base.OnSpotifyConnectionChanged(client); 30 | 31 | // Check if we have permission to access logged in user's playlists 32 | if (SpotifyService.Instance.AreScopesAuthorized(Scopes.PlaylistReadPrivate)) 33 | { 34 | // Get first page from client 35 | Paging page = await client.Playlists.CurrentUsers(); 36 | // Get rest of pages from utility function and set variable to run on main thread 37 | _allPlaylists = await S4UUtility.GetAllOfPagingAsync(client, page); 38 | _isPopulated = false; 39 | } 40 | else 41 | { 42 | Debug.LogError($"Not authorized to access '{Scopes.PlaylistReadPrivate}'"); 43 | } 44 | } 45 | 46 | private void PopulateListUI() 47 | { 48 | // Destroy any previous children, blank list 49 | if (_listViewParent.transform.childCount > 0) 50 | { 51 | foreach(Transform child in _listViewParent.transform) 52 | { 53 | Destroy(child.gameObject); 54 | } 55 | } 56 | 57 | // Iterate through all playlists and instantiate & set playlist 58 | foreach (SimplePlaylist playlist in _allPlaylists) 59 | { 60 | GameObject playlistPrefabGO = Instantiate(_playlistPrefab, _listViewParent); 61 | playlistPrefabGO.name = $"Playlist {playlist.Name}"; 62 | 63 | SinglePlaylistController controller = playlistPrefabGO.GetComponent(); 64 | controller.SetPlaylist(playlist); 65 | } 66 | 67 | if (_allPlaylists.Count() > 0) 68 | { 69 | // Get first inst prefab for it's height/width 70 | RectTransform t = _listViewParent.transform.GetChild(0).GetComponent(); 71 | float singlePrefabWidth = t.rect.width; 72 | float singlePrefabHeight = t.rect.height; 73 | 74 | // Get GridLayout & parent rect 75 | RectTransform parentRect = _listViewParent.GetComponent(); 76 | GridLayoutGroup group = _listViewParent.GetComponent(); 77 | 78 | // Determine how many rows/cols there are 79 | int amtInRow = (int)(parentRect.rect.width / (singlePrefabWidth + (group.spacing.x * 2))); 80 | int amtOfRows = _allPlaylists.Count() / amtInRow; 81 | 82 | // Add spacing to single height and multiple amount of rows 83 | float height = (singlePrefabHeight + group.spacing.y) * amtOfRows; 84 | 85 | // Set parent's new height for scrolling 86 | parentRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Editor/Configs/AuthorizationConfigView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | /// 7 | /// Editor view for base config class 8 | /// 9 | [CustomEditor(typeof(AuthorizationConfig))] 10 | public class AuthorizationConfigView : Editor 11 | { 12 | private AuthorizationConfig _config; 13 | 14 | private int _selectedScopesFlag = int.MaxValue; 15 | 16 | protected virtual void OnEnable() 17 | { 18 | _config = (AuthorizationConfig)target; 19 | } 20 | 21 | public override void OnInspectorGUI() 22 | { 23 | GUIContent content; 24 | 25 | // Title 26 | EditorGUILayout.LabelField("General Config", EditorStyles.boldLabel); 27 | 28 | // Client ID 29 | content = new GUIContent("Spotify Client ID", "Your client id, found in your Spotify Dashboard. Don't have an id? Go here: https://developer.spotify.com/dashboard/"); 30 | _config.ClientID = EditorGUILayout.TextField(content, _config.ClientID); 31 | 32 | content = new GUIContent("Redirect URI", "The redirect uri used to pass Spotify authentification onto your app. This exact URI needs to be in your Spotify Dashboard. Dont change this if you don't know what you are doing."); 33 | _config.RedirectUri = EditorGUILayout.TextField(content, _config.RedirectUri); 34 | 35 | // API scopes 36 | content = new GUIContent("API Scopes", "All API scopes that will the user will be asked to authorize."); 37 | 38 | List allScopes = S4UUtility.GetAllScopes(); 39 | _selectedScopesFlag = EditorGUILayout.MaskField(content, _selectedScopesFlag, allScopes.ToArray()); 40 | _config.APIScopes = FlagToAPIScopes(_selectedScopesFlag); 41 | 42 | EditorGUILayout.Space(); 43 | 44 | EditorGUILayout.HelpBox("The 'API Scopes' allow you to pick and choose which elements of the API you wish to use. It is recommended to select only the required scopes you need. \n\nFor more information, view the Spotify API guide on authorization scopes (Click the button below)", MessageType.Info); 45 | 46 | if (GUILayout.Button("Scopes Documentation")) 47 | Application.OpenURL("https://developer.spotify.com/documentation/general/guides/scopes/"); 48 | 49 | EditorGUILayout.Space(); 50 | } 51 | 52 | /// 53 | /// Converts a flag number into the enabled API scopes 54 | /// 55 | /// 56 | /// 57 | private List FlagToAPIScopes(int flag) 58 | { 59 | List allScopes = S4UUtility.GetAllScopes(); 60 | List selectedScopes = new List(); 61 | 62 | // Convert integer into binary string "10010101" 63 | string binaryString = Convert.ToString(flag, 2); 64 | // Reverse string so order matches list order 65 | var array = binaryString.ToCharArray(); 66 | Array.Reverse(array); 67 | binaryString = new string(array); 68 | 69 | // If binary longer than list, all selected 70 | if (binaryString.Length > allScopes.Count) 71 | { 72 | return allScopes; // All selected 73 | } 74 | else if (binaryString.Length <= 0) 75 | { 76 | return new List(); // Empty, none selected 77 | } 78 | else 79 | { 80 | // Iterate through binary string, add scope if it is enabled in bianry string 81 | for (int i = 0; i < binaryString.Length; i++) 82 | { 83 | char currentBinaryValue = binaryString[i]; 84 | if (currentBinaryValue == '1') 85 | { 86 | selectedScopes.Add(allScopes[i]); 87 | } 88 | } 89 | 90 | return selectedScopes; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/ArtistWidgetController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using System.Linq; 7 | using Image = UnityEngine.UI.Image; 8 | 9 | /// 10 | /// Artist widget for taking an artist's Spotify Id (not URI) and displaying their information 11 | /// This is an example script of how/what you could/should implement 12 | /// 13 | public class ArtistWidgetController : SpotifyServiceListener 14 | { 15 | [Tooltip("Id of the artist to display in thw widget. ")] 16 | public string ArtistId; 17 | 18 | [SerializeField] 19 | private UnityEngine.UI.Image _icon; 20 | 21 | [SerializeField] 22 | private Button _followBtn; 23 | 24 | [SerializeField] 25 | private Text _nameText, _idText, _uriText, _followersText, _genresText, _popularityText, _typeText; 26 | 27 | private FullArtist _artistInfo; 28 | 29 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 30 | { 31 | base.OnSpotifyConnectionChanged(client); 32 | 33 | if (client != null) 34 | { 35 | _artistInfo = await client.Artists.Get(ArtistId); 36 | } 37 | else 38 | { 39 | _artistInfo = null; 40 | } 41 | 42 | UpdateUI(); 43 | } 44 | 45 | private void UpdateUI() 46 | { 47 | if (_artistInfo != null) 48 | { 49 | DownloadUpdateSprite(_icon, _artistInfo.Images); 50 | 51 | UpdateTextElement(_nameText, $"Name: {_artistInfo.Name}"); 52 | UpdateTextElement(_idText, $"Id: {_artistInfo.Id}"); 53 | UpdateTextElement(_uriText, $"URI: {_artistInfo.Uri}"); 54 | UpdateTextElement(_followersText, $"Followers: {_artistInfo.Followers.Total.ToString()}"); 55 | UpdateTextElement(_genresText, $"Genres: {string.Join(", ", _artistInfo.Genres.ToArray())}"); 56 | UpdateTextElement(_popularityText, $"Popularity: {_artistInfo.Popularity}"); 57 | UpdateTextElement(_typeText, $"Type: {_artistInfo.Type}"); 58 | } 59 | else 60 | { 61 | UpdateTextElement(_nameText, string.Empty); 62 | UpdateTextElement(_idText, string.Empty); 63 | UpdateTextElement(_uriText, string.Empty); 64 | UpdateTextElement(_followersText, string.Empty); 65 | UpdateTextElement(_genresText, string.Empty); 66 | UpdateTextElement(_popularityText, string.Empty); 67 | UpdateTextElement(_typeText, string.Empty); 68 | _icon.sprite = null; 69 | } 70 | 71 | // If follow btn set, add listener to on click to follow the current artist 72 | if (_followBtn != null) 73 | { 74 | _followBtn.onClick.AddListener(() => 75 | { 76 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 77 | if (client != null) 78 | { 79 | List allArtistIdsList = new List() { ArtistId }; 80 | FollowRequest followRequest = new FollowRequest(FollowRequest.Type.Artist, allArtistIdsList); 81 | client.Follow.Follow(followRequest); 82 | } 83 | }); 84 | } 85 | } 86 | 87 | private void UpdateTextElement(Text element, string content) 88 | { 89 | if (element != null) 90 | { 91 | element.text = content; 92 | } 93 | } 94 | 95 | private void DownloadUpdateSprite(Image img, List images) 96 | { 97 | if (img != null && img.sprite == null) 98 | { 99 | SpotifyAPI.Web.Image icon = S4UUtility.GetLowestResolutionImage(images); 100 | if (icon != null) 101 | { 102 | StartCoroutine(S4UUtility.LoadImageFromUrl(icon.Url, (loadedSprite) => 103 | { 104 | _icon.sprite = loadedSprite; 105 | })); 106 | } 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/LikedSongsController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using UnityEngine.UI; 7 | 8 | public class LikedSongsController : ViewControllerBase 9 | { 10 | public float HeaderHeight = 300; 11 | public int MaximumLength = 1000; 12 | 13 | [SerializeField] 14 | private Transform _listViewParent; 15 | 16 | [SerializeField] 17 | private Transform _songsParent; 18 | 19 | [SerializeField] 20 | private GameObject _songPrefab; 21 | 22 | [SerializeField] 23 | private Text _subtitleText; 24 | 25 | [SerializeField] 26 | private Transform _headerParent, _loadParent; 27 | 28 | private List _allSavedTracks = new List(); 29 | private string _creator; 30 | 31 | private List _dispatcher = new List(); 32 | 33 | public async void Start() 34 | { 35 | _loadParent.gameObject.SetActive(true); 36 | _headerParent.gameObject.SetActive(false); 37 | _songsParent.gameObject.SetActive(false); 38 | 39 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 40 | if (client != null) 41 | { 42 | Paging paging = await client.Library.GetTracks(); 43 | 44 | // Load all saved tracks 45 | _allSavedTracks = await S4UUtility.GetAllOfPagingAsync(client, paging, MaximumLength) as List; 46 | 47 | // Only show cwer 48 | if (_allSavedTracks.Count > MaximumLength) { 49 | _allSavedTracks.RemoveRange(MaximumLength, (_allSavedTracks.Count - 1) - MaximumLength); 50 | } 51 | 52 | // Load current user to display creator 53 | PrivateUser profile = await SpotifyService.Instance.GetSpotifyClient().UserProfile.Current(); 54 | _creator = profile.DisplayName; 55 | 56 | _dispatcher.Add(() => 57 | { 58 | UpdateUI(); 59 | }); 60 | } 61 | } 62 | 63 | private void Update() 64 | { 65 | if (_dispatcher.Count > 0) 66 | { 67 | foreach(Action actn in _dispatcher) 68 | { 69 | actn.Invoke(); 70 | } 71 | _dispatcher.Clear(); 72 | } 73 | } 74 | 75 | void UpdateUI() 76 | { 77 | _loadParent.gameObject.SetActive(false); 78 | _headerParent.gameObject.SetActive(true); 79 | _songsParent.gameObject.SetActive(true); 80 | 81 | UpdateHeader(); 82 | UpdateTracksList(); 83 | } 84 | 85 | private void UpdateHeader() 86 | { 87 | if (_subtitleText != null) 88 | { 89 | _subtitleText.text = $"{_creator} | Recent {_allSavedTracks.Count} songs"; 90 | } 91 | } 92 | 93 | private void UpdateTracksList() 94 | { 95 | // Clear any existing songs 96 | if (_songsParent.transform.childCount > 0) 97 | { 98 | foreach (Transform child in _songsParent.transform) 99 | { 100 | Destroy(child.gameObject); 101 | } 102 | } 103 | 104 | foreach (SavedTrack savedTrack in _allSavedTracks) 105 | { 106 | GameObject go = Instantiate(_songPrefab, _songsParent); 107 | 108 | SinglePlaylistSelectableTrack trackController = go.GetComponent(); 109 | trackController.SetTrack(savedTrack.Track, ""); 110 | } 111 | 112 | // Get height of prefab 113 | RectTransform t = _songPrefab.transform.GetComponent(); 114 | float singlePrefabHeight = t.rect.height; 115 | 116 | // Determine total new height of parent 117 | float totalHeight = (_allSavedTracks.Count * singlePrefabHeight) + HeaderHeight; 118 | 119 | RectTransform parentRect = _listViewParent.GetComponent(); 120 | // Set parent's new height for scrolling 121 | parentRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, totalHeight); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Prefabs/Loading Spinner.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6371303935235382889 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6371303935235382894} 12 | - component: {fileID: 6371303935235382892} 13 | - component: {fileID: 6371303935235382895} 14 | m_Layer: 5 15 | m_Name: Loading Icon 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!224 &6371303935235382894 22 | RectTransform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 6371303935235382889} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 6371303935979960204} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | m_AnchorMin: {x: 0.5, y: 0.5} 36 | m_AnchorMax: {x: 0.5, y: 0.5} 37 | m_AnchoredPosition: {x: 0, y: 0} 38 | m_SizeDelta: {x: 100, y: 100} 39 | m_Pivot: {x: 0.5, y: 0.5} 40 | --- !u!222 &6371303935235382892 41 | CanvasRenderer: 42 | m_ObjectHideFlags: 0 43 | m_CorrespondingSourceObject: {fileID: 0} 44 | m_PrefabInstance: {fileID: 0} 45 | m_PrefabAsset: {fileID: 0} 46 | m_GameObject: {fileID: 6371303935235382889} 47 | m_CullTransparentMesh: 1 48 | --- !u!114 &6371303935235382895 49 | MonoBehaviour: 50 | m_ObjectHideFlags: 0 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_GameObject: {fileID: 6371303935235382889} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} 58 | m_Name: 59 | m_EditorClassIdentifier: 60 | m_Material: {fileID: 0} 61 | m_Color: {r: 1, g: 1, b: 1, a: 1} 62 | m_RaycastTarget: 1 63 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 64 | m_Maskable: 1 65 | m_OnCullStateChanged: 66 | m_PersistentCalls: 67 | m_Calls: [] 68 | m_Sprite: {fileID: 21300000, guid: c5f4a32936bf82a4fbba41ea66235744, type: 3} 69 | m_Type: 0 70 | m_PreserveAspect: 0 71 | m_FillCenter: 1 72 | m_FillMethod: 4 73 | m_FillAmount: 1 74 | m_FillClockwise: 1 75 | m_FillOrigin: 0 76 | m_UseSpriteMesh: 0 77 | m_PixelsPerUnitMultiplier: 1 78 | --- !u!1 &6371303935979960207 79 | GameObject: 80 | m_ObjectHideFlags: 0 81 | m_CorrespondingSourceObject: {fileID: 0} 82 | m_PrefabInstance: {fileID: 0} 83 | m_PrefabAsset: {fileID: 0} 84 | serializedVersion: 6 85 | m_Component: 86 | - component: {fileID: 6371303935979960204} 87 | - component: {fileID: 5609952171792531700} 88 | m_Layer: 5 89 | m_Name: Loading Spinner 90 | m_TagString: Untagged 91 | m_Icon: {fileID: 0} 92 | m_NavMeshLayer: 0 93 | m_StaticEditorFlags: 0 94 | m_IsActive: 1 95 | --- !u!224 &6371303935979960204 96 | RectTransform: 97 | m_ObjectHideFlags: 0 98 | m_CorrespondingSourceObject: {fileID: 0} 99 | m_PrefabInstance: {fileID: 0} 100 | m_PrefabAsset: {fileID: 0} 101 | m_GameObject: {fileID: 6371303935979960207} 102 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 103 | m_LocalPosition: {x: 0, y: 0, z: 0} 104 | m_LocalScale: {x: 1, y: 1, z: 1} 105 | m_Children: 106 | - {fileID: 6371303935235382894} 107 | m_Father: {fileID: 0} 108 | m_RootOrder: 0 109 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 110 | m_AnchorMin: {x: 0, y: 0} 111 | m_AnchorMax: {x: 0, y: 0} 112 | m_AnchoredPosition: {x: 0, y: 0} 113 | m_SizeDelta: {x: 0, y: 100} 114 | m_Pivot: {x: 0.5, y: 0.5} 115 | --- !u!114 &5609952171792531700 116 | MonoBehaviour: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | m_GameObject: {fileID: 6371303935979960207} 122 | m_Enabled: 1 123 | m_EditorHideFlags: 0 124 | m_Script: {fileID: 11500000, guid: d3ce54fb90e1c5142b1a3b4f556df80c, type: 3} 125 | m_Name: 126 | m_EditorClassIdentifier: 127 | Speed: 1.5 128 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/Views/SearchViewController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using System.Linq; 7 | 8 | public class SearchViewController : ViewControllerBase 9 | { 10 | [SerializeField] 11 | private InputField _searchField; 12 | [SerializeField] 13 | private Button _searchBtn; 14 | 15 | [SerializeField] 16 | private Transform _tracksParent; 17 | [SerializeField] 18 | private GameObject _singleSearchTrackPrefab; 19 | 20 | [SerializeField] 21 | private Transform _artistsParent; 22 | [SerializeField] 23 | private GameObject _singleArtistPrefab; 24 | 25 | private SearchResponse _lastSearchResponse; 26 | 27 | private List _dispatcher = new List(); 28 | 29 | void Start() 30 | { 31 | if (_searchBtn != null) 32 | { 33 | _searchBtn.onClick.AddListener(this.OnPerformSearch); 34 | } 35 | } 36 | 37 | private void Update() 38 | { 39 | if (_dispatcher.Count > 0) 40 | { 41 | foreach (Action actn in _dispatcher) 42 | actn?.Invoke(); 43 | 44 | _dispatcher.Clear(); 45 | } 46 | } 47 | 48 | private async void OnPerformSearch() 49 | { 50 | var client = SpotifyService.Instance.GetSpotifyClient(); 51 | if (client != null && _searchField != null) 52 | { 53 | string query = _searchField.text; 54 | SearchRequest request = new SearchRequest(SearchRequest.Types.All, query); 55 | 56 | _lastSearchResponse = await client.Search.Item(request); 57 | 58 | _dispatcher.Add(() => 59 | { 60 | UpdateUI(); 61 | }); 62 | } 63 | } 64 | 65 | private void UpdateUI() 66 | { 67 | if (_tracksParent != null) 68 | { 69 | UpdateSongsList(); 70 | UpdateArtistsList(); 71 | } 72 | } 73 | 74 | void UpdateSongsList() 75 | { 76 | UpdateScrollView(_lastSearchResponse.Tracks.Items, _singleSearchTrackPrefab, _tracksParent, RectTransform.Axis.Vertical, (instGO, dataObj) => 77 | { 78 | instGO.GetComponent().SetTrack(dataObj); 79 | }); 80 | } 81 | 82 | void UpdateArtistsList() 83 | { 84 | var artistsFiltered = _lastSearchResponse.Artists.Items.Select((x) => 85 | { 86 | if (x.Type == "artist") 87 | return x; 88 | return null; 89 | }).ToList(); 90 | 91 | UpdateScrollView(artistsFiltered, _singleArtistPrefab, _artistsParent, RectTransform.Axis.Horizontal, (instGO, dataObj) => 92 | { 93 | instGO.GetComponent().SetArtist(dataObj); 94 | }); 95 | } 96 | 97 | void UpdateScrollView(List objList, GameObject prefab, Transform parent, RectTransform.Axis axis, Action afterPrefabInst) where T : class 98 | { 99 | if (parent.transform.childCount > 0) 100 | { 101 | foreach (Transform child in parent.transform) 102 | Destroy(child.gameObject); 103 | } 104 | 105 | foreach (T obj in objList) 106 | { 107 | GameObject instGO = Instantiate(prefab, parent); 108 | afterPrefabInst?.Invoke(instGO, obj); 109 | } 110 | 111 | 112 | // get width/height of prefab 113 | float singlePrefabHeightOrWidth = prefab.GetComponent().rect.height; 114 | if (axis == RectTransform.Axis.Horizontal) 115 | singlePrefabHeightOrWidth = prefab.GetComponent().rect.width; 116 | 117 | // Add on spacing + padding 118 | HorizontalOrVerticalLayoutGroup group = parent.GetComponent(); 119 | float total = singlePrefabHeightOrWidth + +group.spacing; 120 | 121 | // Padding on either top/bottom or right/left 122 | if (axis == RectTransform.Axis.Horizontal) 123 | { 124 | total += group.padding.left + group.padding.right; 125 | } 126 | else if (axis == RectTransform.Axis.Vertical) 127 | { 128 | total += group.padding.top + group.padding.bottom; 129 | } 130 | 131 | total = total * objList.Count; 132 | 133 | parent.GetComponent().SetSizeWithCurrentAnchors(axis, total); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Widgets/SingleArtistWidgetController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | using UnityEngine.UI; 7 | 8 | public class SingleArtistWidgetController : SpotifyServiceListener 9 | { 10 | public string ArtistId = ""; 11 | 12 | public Vector2 ImageSize = new Vector2(75, 75); 13 | 14 | [SerializeField] 15 | private Text _artistName; 16 | 17 | [SerializeField] 18 | private UnityEngine.UI.Image _icon; 19 | 20 | [SerializeField] 21 | private Button _playButton, _followButton; 22 | 23 | private FullArtist _artist; 24 | 25 | private List _dispatcher = new List(); 26 | 27 | private void Start() 28 | { 29 | if (_playButton != null) 30 | { 31 | _playButton.onClick.AddListener(() => this.OnPlayArtist()); 32 | } 33 | if (_followButton != null) 34 | { 35 | _followButton.onClick.AddListener(() => this.OnFollowArtist()); 36 | } 37 | 38 | SetUIActive(_artist != null); 39 | } 40 | 41 | private void Update() 42 | { 43 | if (_dispatcher.Count > 0) 44 | { 45 | foreach (Action actn in _dispatcher) 46 | actn.Invoke(); 47 | _dispatcher.Clear(); 48 | } 49 | } 50 | 51 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 52 | { 53 | base.OnSpotifyConnectionChanged(client); 54 | 55 | // On connect, if artist id set, then retrieve from API 56 | if (client != null && !string.IsNullOrEmpty(ArtistId)) 57 | { 58 | _artist = await client.Artists.Get(ArtistId); 59 | 60 | _dispatcher.Add(() => 61 | { 62 | UpdateUI(); 63 | }); 64 | } 65 | else if (_artist == null) 66 | { 67 | // Set to inactive if no artist set 68 | SetUIActive(false); 69 | } 70 | } 71 | 72 | private void UpdateUI() 73 | { 74 | if (_artist != null) 75 | { 76 | SetUIActive(true); 77 | 78 | if (_artistName != null) 79 | { 80 | _artistName.text = _artist.Name; 81 | } 82 | if (_icon != null) 83 | { 84 | // Update to target image size 85 | RectTransform rect = _icon.GetComponent(); 86 | rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, ImageSize.x); 87 | rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, ImageSize.y); 88 | 89 | SpotifyAPI.Web.Image lowestResImg = S4UUtility.GetLowestResolutionImage(_artist.Images); 90 | StartCoroutine(S4UUtility.LoadImageFromUrl(lowestResImg?.Url, (sprite) => 91 | { 92 | _icon.sprite = sprite; 93 | })); 94 | } 95 | } 96 | else 97 | { 98 | SetUIActive(false); 99 | } 100 | } 101 | 102 | private void OnPlayArtist() 103 | { 104 | var client = SpotifyService.Instance.GetSpotifyClient(); 105 | if (client != null) 106 | { 107 | PlayerResumePlaybackRequest request = new PlayerResumePlaybackRequest() 108 | { 109 | ContextUri = _artist.Uri, 110 | }; 111 | client.Player.ResumePlayback(request); 112 | } 113 | } 114 | 115 | private void OnFollowArtist() 116 | { 117 | var client = SpotifyService.Instance.GetSpotifyClient(); 118 | if (client != null) 119 | { 120 | FollowRequest request = new FollowRequest(FollowRequest.Type.Artist, new List() { ArtistId }); 121 | client.Follow.Follow(request); 122 | } 123 | } 124 | 125 | private void SetUIActive(bool isActive) 126 | { 127 | if (_artistName != null) 128 | _artistName.gameObject.SetActive(isActive); 129 | if (_icon != null) 130 | _icon.gameObject.SetActive(isActive); 131 | if (_playButton != null) 132 | _playButton.gameObject.SetActive(isActive); 133 | if (_followButton != null) 134 | _followButton.gameObject.SetActive(isActive); 135 | } 136 | 137 | /// 138 | /// Set the full artist and populate the UI 139 | /// 140 | /// 141 | public void SetArtist(FullArtist artist) 142 | { 143 | _artist = artist; 144 | 145 | UpdateUI(); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Spotify App/PlaylistsNavigationController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | using UnityEngine.UI; 7 | 8 | public class PlaylistsNavigationController : SpotifyServiceListener 9 | { 10 | [SerializeField] 11 | private AppMainContentController _mainContentController; 12 | 13 | [SerializeField] 14 | private Button _homeNavBtn, _searchNavBtn, _likedSongsNavBtn; 15 | 16 | [SerializeField] 17 | private GameObject _playlistPrefab; 18 | 19 | [SerializeField] 20 | private Transform _listViewParent; 21 | 22 | [SerializeField] 23 | private GameObject _loadingSpinnerPrefab; 24 | 25 | private GameObject _liveSpinner; 26 | 27 | private IEnumerable _allPlaylists = null; 28 | 29 | private List _dispatcher = new List(); 30 | 31 | private void Start() 32 | { 33 | if (_homeNavBtn != null) 34 | { 35 | _homeNavBtn.onClick.AddListener(() => 36 | { 37 | if (_mainContentController) 38 | _mainContentController.SetContent(Views.Landing); 39 | }); 40 | } 41 | 42 | if (_searchNavBtn != null) 43 | { 44 | _searchNavBtn.onClick.AddListener(() => 45 | { 46 | if (_mainContentController) 47 | _mainContentController.SetContent(Views.Search); 48 | }); 49 | } 50 | 51 | if (_likedSongsNavBtn != null) 52 | { 53 | _likedSongsNavBtn.onClick.AddListener(() => 54 | { 55 | if (_mainContentController) 56 | _mainContentController.SetContent(Views.LikedSongs); 57 | }); 58 | } 59 | } 60 | 61 | private void Update() 62 | { 63 | if (_dispatcher.Count > 0) 64 | { 65 | foreach(Action actn in _dispatcher) 66 | { 67 | actn.Invoke(); 68 | } 69 | _dispatcher.Clear(); 70 | } 71 | } 72 | 73 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 74 | { 75 | base.OnSpotifyConnectionChanged(client); 76 | 77 | if (_loadingSpinnerPrefab != null) 78 | { 79 | _dispatcher.Add(() => 80 | { 81 | // Create loading spinner 82 | _liveSpinner = Instantiate(_loadingSpinnerPrefab, _listViewParent); 83 | }); 84 | } 85 | 86 | if (client != null) 87 | { 88 | // Get first page from client 89 | Paging page = await client.Playlists.CurrentUsers(); 90 | // Get rest of pages from utility function and set variable to run on main thread 91 | _allPlaylists = await S4UUtility.GetAllOfPagingAsync(client, page); 92 | 93 | _dispatcher.Add(() => 94 | { 95 | // Delete loading spinner 96 | if (_liveSpinner != null) 97 | Destroy(_liveSpinner.gameObject); 98 | 99 | UpdateUI(); 100 | }); 101 | } 102 | else 103 | { 104 | // No client, set playlists to empty 105 | _allPlaylists = new List(); 106 | UpdateUI(); 107 | } 108 | } 109 | 110 | private void UpdateUI() 111 | { 112 | // Destroy any previous children, blank list 113 | if (_listViewParent.transform.childCount > 0) 114 | { 115 | foreach (Transform child in _listViewParent.transform) 116 | { 117 | Destroy(child.gameObject); 118 | } 119 | } 120 | 121 | // Iterate through all playlists and instantiate & set playlist 122 | foreach (SimplePlaylist playlist in _allPlaylists) 123 | { 124 | GameObject playlistPrefabGO = Instantiate(_playlistPrefab, _listViewParent); 125 | playlistPrefabGO.name = $"Playlist {playlist.Name}"; 126 | 127 | SingleNavPlaylistController controller = playlistPrefabGO.GetComponent(); 128 | controller.SetPlaylist(playlist); 129 | 130 | controller.OnPlaylistSelected += this.OnSetPlaylistMainContent; 131 | } 132 | 133 | if (_allPlaylists.Count() > 0) 134 | { 135 | // Get first inst prefab for it's height/width 136 | RectTransform t = _listViewParent.transform.GetChild(0).GetComponent(); 137 | float singlePrefabWidth = t.rect.width; 138 | float singlePrefabHeight = t.rect.height; 139 | 140 | // Get GridLayout & parent rect 141 | RectTransform parentRect = _listViewParent.GetComponent(); 142 | VerticalLayoutGroup group = _listViewParent.GetComponent(); 143 | 144 | // Height is amount of entries + spacing + padding 145 | float allPaddingSpacingPixels = group.padding.top + group.padding.bottom + group.spacing; 146 | float height = (singlePrefabHeight + allPaddingSpacingPixels) * _allPlaylists.Count(); 147 | 148 | // Set parent's new height for scrolling 149 | parentRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height); 150 | } 151 | } 152 | 153 | private void OnSetPlaylistMainContent(SimplePlaylist mainPlaylist) 154 | { 155 | // nav selected new playlist, change main content to display it 156 | 157 | Debug.Log($"Spotify App | Set main content to playlist '{mainPlaylist.Name}'"); 158 | 159 | if (_mainContentController) 160 | { 161 | _mainContentController.SetContent(mainPlaylist); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /Spotify4Unity/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Examples/Scripts/Landing Scene/UserWidgetController.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using Image = UnityEngine.UI.Image; 7 | 8 | /// 9 | /// User widget for displaying a user's public/private information. 10 | /// If a user id (not URI) is provided, it will get their public profile, else if no id is provided, will get the current signed in user's profile 11 | /// This is an example script of how/what you could/should implement 12 | /// 13 | public class UserWidgetController : SpotifyServiceListener 14 | { 15 | [Tooltip("User Id of the spotify user you wish to display in this widget. If none supplied, will display the current signed in user. Can accept username's like 'wizzler' or URI id's like '1121645175. Hold Ctrl or Cmd and click '...' on a user's page toget their URI")] 16 | public string UserId; 17 | 18 | [SerializeField] 19 | private Image _icon; 20 | 21 | [SerializeField] 22 | private Button _followBtn; 23 | 24 | [SerializeField] 25 | private Text _nameText, _followersText, _countryText, _productText, _typeText, _uriText, _idText; 26 | 27 | // Current signed in private user info 28 | private PrivateUser _privateUserInfo = null; 29 | // Public user information available to everyone from user id 30 | private PublicUser _publicUserInfo = null; 31 | 32 | private void Start() 33 | { 34 | if (_icon != null) 35 | { 36 | _icon.gameObject.SetActive(false); 37 | } 38 | } 39 | 40 | protected override async void OnSpotifyConnectionChanged(SpotifyClient client) 41 | { 42 | base.OnSpotifyConnectionChanged(client); 43 | 44 | if (client != null) 45 | { 46 | // Check if we are authorized to read private profile information 47 | if (string.IsNullOrEmpty(UserId)) 48 | { 49 | if (SpotifyService.Instance.AreScopesAuthorized(Scopes.UserReadPrivate)) 50 | { 51 | _privateUserInfo = await client.UserProfile.Current(); 52 | } 53 | else 54 | { 55 | Debug.LogError($"Not authorized to access '{Scopes.UserReadPrivate}'"); 56 | } 57 | } 58 | else 59 | { 60 | _publicUserInfo = await client.UserProfile.Get(UserId); 61 | } 62 | } 63 | else 64 | { 65 | _privateUserInfo = null; 66 | _publicUserInfo = null; 67 | } 68 | 69 | UpdateUI(); 70 | } 71 | 72 | private void UpdateUI() 73 | { 74 | if (_privateUserInfo != null) 75 | { 76 | if (_icon != null) 77 | { 78 | _icon.gameObject.SetActive(true); 79 | 80 | DownloadUpdateSprite(_icon, _privateUserInfo.Images); 81 | } 82 | 83 | UpdateTextElement(_nameText, $"Name: {_privateUserInfo.DisplayName}"); 84 | UpdateTextElement(_followersText, $"Followers: {_privateUserInfo.Followers.Total.ToString()}"); 85 | UpdateTextElement(_typeText, $"Type: {_privateUserInfo.Type}"); 86 | UpdateTextElement(_uriText, $"URI: {_privateUserInfo.Uri}"); 87 | UpdateTextElement(_idText, $"Id: {_privateUserInfo.Id}"); 88 | 89 | // PrivateProfile specific properties 90 | UpdateTextElement(_countryText, $"Country: {_privateUserInfo.Country}"); 91 | UpdateTextElement(_productText, $"Product: {_privateUserInfo.Product}"); 92 | 93 | // Disable follow, cant follow self 94 | if (_followBtn) 95 | _followBtn.gameObject.SetActive(false); 96 | } 97 | else if (_publicUserInfo != null) 98 | { 99 | if (_icon != null) 100 | { 101 | _icon.gameObject.SetActive(true); 102 | 103 | DownloadUpdateSprite(_icon, _publicUserInfo.Images); 104 | } 105 | 106 | UpdateTextElement(_nameText, $"Name: {_publicUserInfo.DisplayName}"); 107 | UpdateTextElement(_followersText, $"Followers: {_publicUserInfo.Followers.Total.ToString()}"); 108 | UpdateTextElement(_typeText, $"Type: {_publicUserInfo.Type}"); 109 | UpdateTextElement(_uriText, $"URI: {_publicUserInfo.Uri}"); 110 | UpdateTextElement(_idText, $"Id: {_publicUserInfo.Id}"); 111 | 112 | if (_productText) 113 | _productText.gameObject.SetActive(false); 114 | if (_countryText) 115 | _countryText.gameObject.SetActive(false); 116 | 117 | 118 | if (_followBtn != null) 119 | { 120 | _followBtn.onClick.AddListener(() => 121 | { 122 | SpotifyClient client = SpotifyService.Instance.GetSpotifyClient(); 123 | if (client != null) 124 | { 125 | List allArtistIdsList = new List() { UserId }; 126 | FollowRequest followRequest = new FollowRequest(FollowRequest.Type.Artist, allArtistIdsList); 127 | client.Follow.Follow(followRequest); 128 | } 129 | }); 130 | } 131 | } 132 | else 133 | { 134 | // Both null, not loaded 135 | UpdateTextElement(_nameText, string.Empty); 136 | UpdateTextElement(_followersText, string.Empty); 137 | UpdateTextElement(_typeText, string.Empty); 138 | UpdateTextElement(_uriText, string.Empty); 139 | UpdateTextElement(_idText, string.Empty); 140 | UpdateTextElement(_countryText, string.Empty); 141 | UpdateTextElement(_productText, string.Empty); 142 | 143 | if (_icon != null) 144 | { 145 | _icon.sprite = null; 146 | _icon.gameObject.SetActive(false); 147 | } 148 | } 149 | } 150 | 151 | private void UpdateTextElement(Text element, string content) 152 | { 153 | if (element != null && !string.IsNullOrEmpty(content)) 154 | { 155 | element.text = content; 156 | } 157 | } 158 | 159 | private void DownloadUpdateSprite(Image img, List images) 160 | { 161 | if (img != null && img.sprite == null) 162 | { 163 | SpotifyAPI.Web.Image image = S4UUtility.GetLowestResolutionImage(images); 164 | if (image != null) 165 | { 166 | StartCoroutine(S4UUtility.LoadImageFromUrl(image.Url, (loadedSprite) => 167 | { 168 | _icon.sprite = loadedSprite; 169 | })); 170 | } 171 | } 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /Spotify4Unity/Assets/Spotify4Unity/Unity/SpotifyPlayerListener.cs: -------------------------------------------------------------------------------- 1 | using SpotifyAPI.Web; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using UnityEngine; 7 | 8 | /// 9 | /// Listener class for listening to the current playing context on Spotify 10 | /// and providing callbacks related to the context 11 | /// 12 | public class SpotifyPlayerListener : SpotifyServiceListener 13 | { 14 | /// 15 | /// Amount of milliseconds for the internal player updater to poll at 16 | /// 17 | public float UpdateFrequencyMS = 1000; 18 | 19 | /// 20 | /// Triggered when a new Track or Episode is playing in the player 21 | /// 22 | public event Action OnPlayingItemChanged; 23 | 24 | // Current connected spotify client 25 | private SpotifyClient _client; 26 | 27 | // The last retrieved context from API 28 | private CurrentlyPlayingContext _currentContext; 29 | // Current playing item within context 30 | private IPlayableItem _currentItem; 31 | // Is the internal update loop being invoked? 32 | private bool _isInvoking = false; 33 | 34 | protected override void Awake() 35 | { 36 | base.Awake(); 37 | 38 | this.OnPlayingItemChanged += PlayingItemChanged; 39 | } 40 | 41 | protected override void OnSpotifyConnectionChanged(SpotifyClient client) 42 | { 43 | base.OnSpotifyConnectionChanged(client); 44 | 45 | _client = client; 46 | 47 | // Start internal update loop 48 | if (_client != null && UpdateFrequencyMS > 0) 49 | { 50 | if (SpotifyService.Instance.AreScopesAuthorized(Scopes.UserReadPlaybackState)) 51 | { 52 | InvokeRepeating(nameof(FetchLatestPlayer), 0, UpdateFrequencyMS / 1000); 53 | _isInvoking = true; 54 | } 55 | else 56 | { 57 | Debug.LogError($"Not authorized to access '{Scopes.UserReadPlaybackState}'"); 58 | } 59 | } 60 | else if (_client == null && _isInvoking) 61 | { 62 | CancelInvoke(nameof(FetchLatestPlayer)); 63 | _isInvoking = false; 64 | 65 | // Invoke playing item changed, no more client, no more context 66 | OnPlayingItemChanged?.Invoke(null); 67 | } 68 | } 69 | 70 | protected virtual void PlayingItemChanged(IPlayableItem item) 71 | { 72 | // Override me. 73 | } 74 | 75 | private async void FetchLatestPlayer() 76 | { 77 | if (_client != null) 78 | { 79 | // get the current context on this run 80 | CurrentlyPlayingContext newContext = await _client.Player.GetCurrentPlayback(); 81 | 82 | // Check if not null 83 | if (newContext != null && newContext.Item != null) 84 | { 85 | // Check and cast the item to the correct type 86 | if (newContext.Item.Type == ItemType.Track) 87 | { 88 | FullTrack currentTrack = newContext.Item as FullTrack; 89 | 90 | // No previous track or previous item was different type 91 | if (_currentItem == null || (_currentItem != null && _currentItem is FullEpisode episode)) 92 | { 93 | Debug.Log($"No prev track or new type | -> '{S4UUtility.GetTrackString(currentTrack)}'"); 94 | _currentItem = currentTrack; 95 | OnPlayingItemChanged?.Invoke(_currentItem); 96 | } 97 | else if (_currentItem != null && _currentItem is FullTrack lastTrack) 98 | { 99 | // Check if track name & artists aren't the same 100 | if (lastTrack.Name != currentTrack.Name || S4UUtility.HasArtistsChanged(lastTrack.Artists, currentTrack.Artists)) 101 | { 102 | Debug.Log($"Track to new Track | '{S4UUtility.GetTrackString(lastTrack)}' -> '{S4UUtility.GetTrackString(currentTrack)}'"); 103 | _currentItem = currentTrack; 104 | OnPlayingItemChanged?.Invoke(_currentItem); 105 | } 106 | } 107 | } 108 | else if (newContext.Item.Type == ItemType.Episode) 109 | { 110 | FullEpisode currentEpisode = newContext.Item as FullEpisode; 111 | 112 | // If no previous item or current item is different type 113 | if (_currentItem == null || (_currentItem != null && _currentItem is FullTrack track)) 114 | { 115 | Debug.Log($"No prev episode or new type | -> '{currentEpisode.Show.Publisher} {currentEpisode.Name}'"); 116 | _currentItem = currentEpisode; 117 | OnPlayingItemChanged?.Invoke(_currentItem); 118 | } 119 | else if (_currentItem != null && _currentItem is FullEpisode lastEpisode) 120 | { 121 | if (lastEpisode.Name != currentEpisode.Name || lastEpisode.Show?.Publisher != currentEpisode.Show?.Publisher) 122 | { 123 | Debug.Log($"Episode to new Episode | '{lastEpisode.Show.Publisher} {lastEpisode.Name}' -> '{currentEpisode.Show.Publisher} {currentEpisode.Name}'"); 124 | _currentItem = currentEpisode; 125 | OnPlayingItemChanged?.Invoke(_currentItem); 126 | } 127 | } 128 | } 129 | } 130 | else 131 | { 132 | // No context or null current playing item 133 | 134 | // If previous item has been set 135 | if (_currentItem != null) 136 | { 137 | Debug.Log($"Context null | '{(_currentItem.Type == ItemType.Track ? (_currentItem as FullTrack).Name : (_currentItem as FullEpisode).Name)}' -> ?"); 138 | _currentItem = null; 139 | OnPlayingItemChanged?.Invoke(null); 140 | } 141 | } 142 | 143 | _currentContext = newContext; 144 | } 145 | else 146 | { 147 | // If no client but has a previous item, invoke event 148 | if (_currentItem != null) 149 | { 150 | _currentItem = null; 151 | OnPlayingItemChanged?.Invoke(null); 152 | } 153 | } 154 | } 155 | 156 | /// 157 | /// Gets the current context of the spotify player 158 | /// 159 | /// 160 | protected CurrentlyPlayingContext GetCurrentContext() 161 | { 162 | return _currentContext; 163 | } 164 | } 165 | --------------------------------------------------------------------------------