diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..19e79874 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +7# This .gitignore file should be placed at the root of your Unity +project directory +# +# Get latest from +https://github.com/github/gitignore/blob/master/Unity.gitignore +# +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Mm]emoryCaptures/ + +# Never ignore Asset meta data +!/[Aa]ssets/**/*.meta + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +[Aa]ssets/Plugins/Editor/JetBrains* + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage + +# Crashlytics generated file +crashlytics-build.properties + +.idea + diff --git a/.vscode/settings.json b/.vscode/settings.json index 217bad1b..28608447 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -56,5 +56,5 @@ "temp/": true, "Temp/": true }, - "dotnet.defaultSolution": "xroom.sln" + "dotnet.defaultSolution": "gitdadechin.sln" } \ No newline at end of file diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj index 44019695..eecf0e41 100644 --- a/Assembly-CSharp-Editor.csproj +++ b/Assembly-CSharp-Editor.csproj @@ -1,35 +1,38 @@ - - + - 9.0 + Temp\obj\$(Configuration)\$(MSBuildProjectName) + $(BaseIntermediateOutputPath) + + + + + false + false + false + 9.0 + Debug;Release Debug AnyCPU - 10.0.20506 - 2.0 - {1744771A-3D62-EB4A-D39C-B11BAE626AEE} Library Properties Assembly-CSharp-Editor - v4.7.1 - 512 + netstandard2.1 . - - 0169;USG0001 - UNITY_6000_0_48;UNITY_6000_0;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_NATIVE_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_ENGINE_CODE_STRIPPING;ENABLE_ONSCREEN_KEYBOARD;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ACCESSIBILITY;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_ANDROID;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;UNITY_CAN_SHOW_SPLASH_SCREEN;UNITY_HAS_GOOGLEVR;UNITY_HAS_TANGO;ENABLE_SPATIALTRACKING;ENABLE_ETC_COMPRESSION;PLATFORM_EXTENDS_VULKAN_DEVICE;PLATFORM_HAS_MULTIPLE_SWAPCHAINS;UNITY_ANDROID_SUPPORTS_SHADOWFILES;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;PLATFORM_EXTENDS_VULKAN_PIPELINE_CACHE;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;PLATFORM_HAS_ADDITIONAL_API_CHECKS;PLATFORM_HAS_BUGGY_MSAA_RESOLVE;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;FUSION_WEAVER;FUSION2;READY_PLAYER_ME;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER;UNITY_EDITOR_ONLY_COMPILATION - True - true full false Temp\bin\Debug\ + UNITY_6000_0_48;UNITY_6000_0;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_AMD;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;PLATFORM_USES_EXPLICIT_MEMORY_MANAGER_INITIALIZER;PLATFORM_SUPPORTS_WAIT_FOR_PRESENTATION;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;FUSION_WEAVER;FUSION2;READY_PLAYER_ME;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER;UNITY_EDITOR_ONLY_COMPILATION prompt 4 + 0169;USG0001 + True pdbonly @@ -37,25 +40,25 @@ Temp\bin\Release\ prompt 4 + 0169;USG0001 + True - true + true true - false - false - false + true + true + MSB3277 - {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Package - 2.0.23 - Legacy + 2.0.25 + SDK Editor:5 - Android:13 + StandaloneWindows64:19 6000.0.48f1 - @@ -1544,94 +1547,48 @@ - - {BCF81C60-B27E-59BC-2489-304D6CE6F9B6} - Assembly-CSharp - - - {02F38F0B-845B-9E49-468F-FE23CDAA2F5D} - Paroxe.PDFRenderer - - - {794422FF-310C-9E32-D148-66A5BDC0D754} - PhotonVoice.Fusion.Editor - - - {362579EE-69FB-D892-7242-B7BBD73292F3} - Fusion.Unity - - - {3E839FFB-0EEB-8A86-00D5-2F986AE09F29} - RTLTMPro-Editor - - - {FB924014-A3DA-444B-2E65-5F499EB1E4B7} - PhotonRealtime - - - {FBEEC828-9655-314B-6FFB-06535D38FB8B} - PhotonVoice.Utilities.Editor - - - {F6EC86B2-74B6-66E2-92CD-AB0F7B980089} - Unity.XR.Interaction.Toolkit.Samples.SpatialKeyboard - - - {77EC1535-0F51-FC33-7569-6319E51B4764} - RTLTMPro - - - {28B1E00A-0F67-79A2-51D9-4BBACA33501D} - PhotonVoice.API - - - {30D80258-4B74-2B1E-FE8A-40D849700894} - Fusion.Addons.Physics - - - {1E0A7769-5DC9-2A12-78BD-51F1CFBAFA82} - PhotonVoice - - - {5668B588-E965-E797-A802-D09E7C2D442C} - Fusion.Unity.Editor - - - {5DBBD5A6-AE0A-8388-06E5-3B1436BC9183} - BNGHandPoseID - - - {F74CB9A9-8860-8AE8-69DF-3AC6832BA89D} - MicAmplifierEditor.Editor - - - {717A50DB-563A-1C17-7054-7B2C654B72AF} - Paroxe.PDFRenderer.Editor - - - {01F8A9E8-A55B-9A21-24E3-B15A8553A6D0} - Unity.XR.Interaction.Toolkit.Samples.SpatialKeyboard.Editor - - - {4E63FDFC-4120-FE47-E713-ADE891043A9E} - Voice.FMOD.Editor - - - {053174A6-EA02-2514-B3A5-E4FDEBA15F6D} - PhotonVoice.Fusion - - - {EB8311CD-A967-3EF7-CC99-280ED99ADA62} - PhotonVoice.Editor - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index a41bfeee..cc29dba3 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -1,35 +1,38 @@ - - + - 9.0 + Temp\obj\$(Configuration)\$(MSBuildProjectName) + $(BaseIntermediateOutputPath) + + + + + false + false + false + 9.0 + Debug;Release Debug AnyCPU - 10.0.20506 - 2.0 - {BCF81C60-B27E-59BC-2489-304D6CE6F9B6} Library Properties Assembly-CSharp - v4.7.1 - 512 + netstandard2.1 . - - 0169;USG0001 - UNITY_6000_0_48;UNITY_6000_0;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_NATIVE_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_ENGINE_CODE_STRIPPING;ENABLE_ONSCREEN_KEYBOARD;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;ENABLE_ACCESSIBILITY;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_ANDROID;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;UNITY_CAN_SHOW_SPLASH_SCREEN;UNITY_HAS_GOOGLEVR;UNITY_HAS_TANGO;ENABLE_SPATIALTRACKING;ENABLE_ETC_COMPRESSION;PLATFORM_EXTENDS_VULKAN_DEVICE;PLATFORM_HAS_MULTIPLE_SWAPCHAINS;UNITY_ANDROID_SUPPORTS_SHADOWFILES;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;PLATFORM_EXTENDS_VULKAN_PIPELINE_CACHE;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;PLATFORM_HAS_ADDITIONAL_API_CHECKS;PLATFORM_HAS_BUGGY_MSAA_RESOLVE;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;FUSION_WEAVER;FUSION2;READY_PLAYER_ME;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER - True - true full false Temp\bin\Debug\ + UNITY_6000_0_48;UNITY_6000_0;UNITY_6000;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;UNITY_2022_1_OR_NEWER;UNITY_2022_2_OR_NEWER;UNITY_2022_3_OR_NEWER;UNITY_2023_1_OR_NEWER;UNITY_2023_2_OR_NEWER;UNITY_2023_3_OR_NEWER;UNITY_6000_0_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_EDITOR_GAME_SERVICES;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_GENERATE_NATIVE_PLUGINS_FOR_ASSEMBLIES_API;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_MARSHALLING_TESTS;ENABLE_VIDEO;ENABLE_NAVIGATION_OFFMESHLINK_TO_NAVMESHLINK;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;TEXTCORE_1_0_OR_NEWER;EDITOR_ONLY_NAVMESH_BUILDER_DEPRECATED;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_AMD;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;PLATFORM_USES_EXPLICIT_MEMORY_MANAGER_INITIALIZER;PLATFORM_SUPPORTS_WAIT_FOR_PRESENTATION;PLATFORM_SUPPORTS_SPLIT_GRAPHICS_JOBS;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_INPUT_SYSTEM;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;TEXTCORE_TEXT_ENGINE_1_5_OR_NEWER;FUSION_WEAVER;FUSION2;READY_PLAYER_ME;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER prompt 4 + 0169;USG0001 + True pdbonly @@ -37,25 +40,25 @@ Temp\bin\Release\ prompt 4 + 0169;USG0001 + True - true + true true - false - false - false + true + true + MSB3277 - {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Package - 2.0.23 - Legacy + 2.0.25 + SDK Game:1 - Android:13 + StandaloneWindows64:19 6000.0.48f1 - @@ -115,6 +118,7 @@ + @@ -186,6 +190,7 @@ + @@ -194,6 +199,7 @@ + @@ -249,6 +255,7 @@ + @@ -340,6 +347,7 @@ + @@ -574,6 +582,14 @@ C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll False + + C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + False + + + C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + False + C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.ContentLoadModule.dll False @@ -806,6 +822,10 @@ C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll False + + C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + False + C:\Program Files\Unity\Hub\Editor\6000.0.48f1\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll False @@ -1900,90 +1920,47 @@ - - {02F38F0B-845B-9E49-468F-FE23CDAA2F5D} - Paroxe.PDFRenderer - - - {794422FF-310C-9E32-D148-66A5BDC0D754} - PhotonVoice.Fusion.Editor - - - {362579EE-69FB-D892-7242-B7BBD73292F3} - Fusion.Unity - - - {3E839FFB-0EEB-8A86-00D5-2F986AE09F29} - RTLTMPro-Editor - - - {FB924014-A3DA-444B-2E65-5F499EB1E4B7} - PhotonRealtime - - - {FBEEC828-9655-314B-6FFB-06535D38FB8B} - PhotonVoice.Utilities.Editor - - - {F6EC86B2-74B6-66E2-92CD-AB0F7B980089} - Unity.XR.Interaction.Toolkit.Samples.SpatialKeyboard - - - {77EC1535-0F51-FC33-7569-6319E51B4764} - RTLTMPro - - - {28B1E00A-0F67-79A2-51D9-4BBACA33501D} - PhotonVoice.API - - - {30D80258-4B74-2B1E-FE8A-40D849700894} - Fusion.Addons.Physics - - - {1E0A7769-5DC9-2A12-78BD-51F1CFBAFA82} - PhotonVoice - - - {5668B588-E965-E797-A802-D09E7C2D442C} - Fusion.Unity.Editor - - - {5DBBD5A6-AE0A-8388-06E5-3B1436BC9183} - BNGHandPoseID - - - {F74CB9A9-8860-8AE8-69DF-3AC6832BA89D} - MicAmplifierEditor.Editor - - - {717A50DB-563A-1C17-7054-7B2C654B72AF} - Paroxe.PDFRenderer.Editor - - - {01F8A9E8-A55B-9A21-24E3-B15A8553A6D0} - Unity.XR.Interaction.Toolkit.Samples.SpatialKeyboard.Editor - - - {4E63FDFC-4120-FE47-E713-ADE891043A9E} - Voice.FMOD.Editor - - - {053174A6-EA02-2514-B3A5-E4FDEBA15F6D} - PhotonVoice.Fusion - - - {EB8311CD-A967-3EF7-CC99-280ED99ADA62} - PhotonVoice.Editor - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - diff --git a/Assets/ApiConnection.cs b/Assets/ApiConnection.cs index 22245804..7e0efd0f 100644 --- a/Assets/ApiConnection.cs +++ b/Assets/ApiConnection.cs @@ -31,6 +31,7 @@ public class ApiConnection : MonoBehaviour public List imageLinks = new List(); public List pdfLinks = new List(); public List videoLinks = new List(); + public List glbLinks = new List(); public static ApiConnection instance; public GameObject imageItem, videoItem; public GameObject pdfItem; @@ -45,7 +46,7 @@ public class ApiConnection : MonoBehaviour } public void jobs(GetInfoResponse data) { - + Debug.Log("getInfoCall"); if (data != null) { foreach (var img in data.images) @@ -87,6 +88,13 @@ public class ApiConnection : MonoBehaviour foreach (var glb in data.glbs) { Debug.Log("GLB: " + glb.glb); + glbLinks.Add("http://194.62.43.230:8000/" + glb.glb); + // Store the first GLB URL in PlayerPrefs for avatar use + if (glbLinks.Count == 1) + { + PlayerPrefs.SetString("profile_glb", "http://194.62.43.230:8000/" + glb.glb); + PlayerPrefs.Save(); + } } } diff --git a/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs b/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs index cec92c87..b7a2ea7b 100644 --- a/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs +++ b/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs @@ -211,7 +211,7 @@ namespace BNG { void LateUpdate() { if (ConnectionManager.instance.runner.IsConnectedToServer) { - print(ConnectionManager.instance.runner.LocalPlayer.PlayerId); + //print(ConnectionManager.instance.runner.LocalPlayer.PlayerId); if (ConnectionManager.instance.presentation && !ConnectionManager.instance.Loading.gameObject.activeSelf&& ConnectionManager.instance. runner.LocalPlayer.PlayerId>1) { // GetComponent().sit = true; diff --git a/Assets/BNG Framework/Scripts/UI/VRKeyboardKey.cs b/Assets/BNG Framework/Scripts/UI/VRKeyboardKey.cs index 7ecdbd46..fea3d7d6 100644 --- a/Assets/BNG Framework/Scripts/UI/VRKeyboardKey.cs +++ b/Assets/BNG Framework/Scripts/UI/VRKeyboardKey.cs @@ -1,13 +1,15 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.UI; +using TMPro; namespace BNG { public class VRKeyboardKey : MonoBehaviour { UnityEngine.UI.Button thisButton; - UnityEngine.UI.Text thisButtonText; + TextMeshProUGUI thisButtonText; VRKeyboard vrKeyboard; @@ -20,7 +22,7 @@ namespace BNG { void Awake() { thisButton = GetComponent(); - thisButtonText = GetComponentInChildren(); + thisButtonText = GetComponentInChildren(); // Assign click event handler if (thisButton != null) { diff --git a/Assets/Coworking office/Room10_sit.unity b/Assets/Coworking office/Room10_sit.unity new file mode 100644 index 00000000..760d2a4f --- /dev/null +++ b/Assets/Coworking office/Room10_sit.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:387274b556d41b6dad0a343df66e3b6eb7bf8ce8ac55a444426829aed1371cd2 +size 3676757 diff --git a/Assets/Coworking office/Room10_sit.unity.meta b/Assets/Coworking office/Room10_sit.unity.meta new file mode 100644 index 00000000..0964f75d --- /dev/null +++ b/Assets/Coworking office/Room10_sit.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 17d5c11186bc848408d522c472023d95 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ENMenu.cs b/Assets/ENMenu.cs index 6ce56a47..4bc74515 100644 --- a/Assets/ENMenu.cs +++ b/Assets/ENMenu.cs @@ -1,49 +1,58 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; +using System.Collections; +using UnityEngine.Networking; +using BNG; +using Fusion.XR.Host.Rig; +using Fusion; -public class ENMenu : MonoBehaviour +public class ENMenu : NetworkBehaviour { - - public GameObject itemPr; public Transform menu; - - public List items = new List(); - // Start is called once before the first execution of Update after the MonoBehaviour is created + + public GameObject tablet; + public UnityEngine.UI.Button button; + public GameObject loading; + public GameObject LoginMenu; + public GameObject Rooms; + public InputField phone, code; + public GameObject LoginButton, EnterButton, ExitButton, GuestButton; + + public NetworkObject glbDownloaderPrefab; + public GameObject playerPref; + + private bool isRunnerReady = false; + + public float delay = 2; + + public override void Spawned() + { + isRunnerReady = true; + } + void Start() { Invoke("PlayWelcome", delay); - //for (int i = 0; i < EN.instance.users.Count; i++) - //{ - //GameObject select= Instantiate(itemPr,menu); - // select.gameObject.SetActive(true); - // select.transform.Find("number").GetComponent().text = "."+i; - // select.transform.Find("name").GetComponent().text = EN.instance.users[i].name; - // select.transform.Find("job").GetComponent().text = EN.instance.users[i].job; - // select.name = i.ToString(); - // items.Add(select); - //} - EN.instance.SelectedUser = EN.instance.users[1]; - string user = PlayerPrefs.GetString("user",""); + + EN.instance.SelectedUser = EN.instance.users[0]; + string user = PlayerPrefs.GetString("user", ""); + if (!string.IsNullOrEmpty(user)) { User response = new User(user); - phone.text= PlayerPrefs.GetString("mobile_number", ""); - code.text= PlayerPrefs.GetString("password",""); + phone.text = PlayerPrefs.GetString("mobile_number", ""); + code.text = PlayerPrefs.GetString("password", ""); + var data = new Dictionary - { - { "password",code.text.ToString() }, - { "mobile_number",phone.text.ToString() } - }; + { + { "password", code.text.ToString() }, + { "mobile_number", phone.text.ToString() } + }; StartCoroutine(webservice.instance.LoginRequest(data, OnLoginSuccess)); - //OnLoginSuccess(response); - //LoginButton.SetActive(false); - //GuestButton.SetActive(false); - //ExitButton.SetActive(true); - //EnterButton.SetActive(true); } else { @@ -52,8 +61,8 @@ public class ENMenu : MonoBehaviour ExitButton.SetActive(false); EnterButton.SetActive(false); } - } + public void exitAccount() { LoginButton.SetActive(true); @@ -61,28 +70,27 @@ public class ENMenu : MonoBehaviour ExitButton.SetActive(false); EnterButton.SetActive(false); PlayerPrefs.SetString("user", ""); - PlayerPrefs.SetString("mobile_number", ""); - PlayerPrefs.SetString("password", ""); + PlayerPrefs.SetString("mobile_number", ""); + PlayerPrefs.SetString("password", ""); } - public GameObject tablet; public void Login() { LoginMenu.gameObject.SetActive(false); loading.gameObject.SetActive(true); + var data = new Dictionary { - { "password",code.text.ToString() }, - { "mobile_number",phone.text.ToString() } + { "password", code.text.ToString() }, + { "mobile_number", phone.text.ToString() } }; + PlayerPrefs.SetString("mobile_number", phone.text.ToString()); PlayerPrefs.SetString("password", code.text.ToString()); + StartCoroutine(webservice.instance.LoginRequest(data, OnLoginSuccess)); } - public Button button; - public GameObject loading; - public GameObject LoginMenu; - public GameObject Rooms; + void OnLoginSuccess(User response) { loading.gameObject.SetActive(false); @@ -90,14 +98,17 @@ public class ENMenu : MonoBehaviour if (response != null) { EN.instance.Me = response; - Debug.Log("ورود موفقیت‌آمیز!"); - Debug.Log("توکن: " + response.token); + LoginMenu.SetActive(false); Rooms.SetActive(true); LoginButton.SetActive(false); GuestButton.SetActive(false); ExitButton.SetActive(true); EnterButton.SetActive(true); + Debug.Log("Login successful"); + + // Call GetInfo after successful login + StartCoroutine(webservice.instance.GetInfoRequest(OnGetInfoSuccess)); } else { @@ -107,45 +118,55 @@ public class ENMenu : MonoBehaviour LoginMenu.gameObject.SetActive(true); EN.instance.showError("خطا در ورود", webservice.instance.lastErrorResponse?.message ?? "نام کاربری یا رمز عبور اشتباه است"); break; - case ErrorType.Network: EN.instance.showError("خطای اتصال", "لطفاً اتصال اینترنت خود را بررسی کنید و دوباره تلاش کنید"); break; - case ErrorType.Server: EN.instance.showError("خطای سرور", "در حال حاضر سرور در دسترس نیست. لطفاً کمی بعد تلاش کنید"); break; - default: EN.instance.showError("خطا", webservice.instance.lastError ?? "خطای ناشناخته رخ داده است"); break; } } } - public float delay = 2; + + void OnGetInfoSuccess(GetInfoResponse response) + { + if (response != null) + { + // Update user information with GetInfo response + EN.instance.Me.characterUrl = response.customer.profile_glb; + EN.instance.Me.character=playerPref; + Debug.Log("GetInfo successful - Character URL: " + response.customer.profile_glb); + } + else + { + Debug.LogError("Failed to get user info: " + webservice.instance.lastError); + EN.instance.showError("خطا", "در دریافت اطلاعات کاربر مشکلی پیش آمده است"); + } + } + public void PlayWelcome() { PlaySound("welcome"); } + public void PlaySound(string soundName, float volume = 1f) { - // بارگذاری صدا از پوشه Resources AudioClip clip = Resources.Load("sounds/" + soundName); if (clip != null) { - // ایجاد یک GameObject جدید برای پخش صدا GameObject audioObject = new GameObject("AudioSource_" + soundName); AudioSource audioSource = audioObject.AddComponent(); audioSource.volume = volume; audioSource.spatialBlend = 0; - // تنظیم clip و پخش صدا audioSource.clip = clip; audioSource.Play(); - // حذف GameObject بعد از پایان صدا Destroy(audioObject, clip.length); } else @@ -153,31 +174,28 @@ public class ENMenu : MonoBehaviour Debug.LogError("Sound not found: " + soundName); } } + public void Exit() { Application.Quit(); } + public void Select(GameObject i) { EN.instance.SelectedUser = EN.instance.users[int.Parse(i.name)]; - - } + } + public void SelectEnviroment(GameObject i) { - Application.LoadLevel(int.Parse(i.name)+1); - + Application.LoadLevel(int.Parse(i.name) + 1); } - public InputField phone, code; - // Update is called once per frame void Update() { - tablet.gameObject.SetActive(!EN.instance.Error.gameObject.activeSelf); - button.interactable = phone.text.Length>10&&code.text.Length>3; + button.interactable = phone.text.Length > 10 && code.text.Length > 3; if (Application.isEditor) tablet.transform.parent = null; } - public GameObject LoginButton,EnterButton,ExitButton,GuestButton; -} +} \ No newline at end of file diff --git a/Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr.meta b/Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr.meta index c9acd874..2e85cb20 100644 --- a/Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr.meta +++ b/Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr.meta @@ -1,9 +1,16 @@ fileFormatVersion: 2 guid: 9960b70afbb00c1468c54c31462b736a +AssetOrigin: + serializedVersion: 1 + productId: 141496 + packageName: Procedural fire + packageVersion: 1.1.0 + assetPath: Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr + uploadId: 454218 TextureImporter: - fileIDToRecycleName: {} + internalIDToNameTable: [] externalObjects: {} - serializedVersion: 5 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 1 @@ -20,7 +27,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -52,40 +64,74 @@ TextureImporter: textureType: 6 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 platformSettings: - - serializedVersion: 2 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 + textureCompression: 2 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 spriteSheet: serializedVersion: 2 sprites: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: + internalID: 0 vertices: [] indices: edges: [] weights: [] - spritePackingTag: + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 userData: assetBundleName: assetBundleVariant: -AssetOrigin: - serializedVersion: 1 - productId: 141496 - packageName: Procedural fire - packageVersion: 1.1.0 - assetPath: Assets/Hovl Studio/Procedural fire/Demo scene/Lightmap-0_comp_light.exr - uploadId: 454218 diff --git a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs index 8bd37f1c..5658ace0 100644 --- a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs +++ b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs @@ -1,4 +1,4 @@ -using BNG; +using BNG; using Fusion.Sockets; using Fusion.XR.Host.Rig; using Photon.Realtime; @@ -46,7 +46,7 @@ namespace Fusion.Addons.ConnectionManagerAddon { FusionRig.instance.transform.position = usersPlace[0].transform.position; } - if (runner.IsConnectedToServer&&presentation&&!PlayerTeleport.instance.chair&&runner.LocalPlayer.PlayerId>1) + if (runner.IsConnectedToServer&&presentation&&!PlayerTeleport.instance.chair&&runner.LocalPlayer.PlayerId>0) { chairs[runner.LocalPlayer.PlayerId].GetComponent().SetSit(); @@ -92,7 +92,7 @@ namespace Fusion.Addons.ConnectionManagerAddon if (!EN.instance) { - Application.LoadLevel(0); + //Application.LoadLevel(0); Destroy(gameObject); return; } @@ -116,7 +116,7 @@ namespace Fusion.Addons.ConnectionManagerAddon private async void Start() { chairs = GameObject.FindGameObjectsWithTag("chair"); - Invoke("createChairs", 5); + //Invoke("createChairs", 5); PlaySound("intro"); // Launch the connection at start if (connectOnStart) await Connect(); @@ -244,7 +244,7 @@ namespace Fusion.Addons.ConnectionManagerAddon //if (laser) // runner.Despawn(laser); - tablet = runner.Spawn(Tablet, position: trans.position, rotation: trans.rotation, inputAuthority: runner.LocalPlayer, (runner, obj) => { + tablet = runner.Spawn(Tablet, position: itemPos.position, rotation: itemPos.rotation, inputAuthority: runner.LocalPlayer, (runner, obj) => { // obj.GetComponent().DrawColor = color; @@ -318,7 +318,7 @@ namespace Fusion.Addons.ConnectionManagerAddon { Debug.Log($"OnPlayerJoined. PlayerId: {player.PlayerId}" + usersPlace[runner.SessionInfo.PlayerCount - 1].transform.position.ToString()); - networkPlayerObject = runner.Spawn(EN.instance.SelectedUser.character, position: pos.position, rotation: transform.rotation, inputAuthority: player, (runner, obj) => { + networkPlayerObject = runner.Spawn(EN.instance.Me.character, position: pos.position, rotation: transform.rotation, inputAuthority: player, (runner, obj) => { obj.GetComponent().player = player; // obj.GetComponent().RPC_RequestCharacterSpawn(player); @@ -384,11 +384,13 @@ namespace Fusion.Addons.ConnectionManagerAddon public void OnShutdown(NetworkRunner runner, ShutdownReason shutdownReason) { Debug.Log("Shutdown: " + shutdownReason); + //Application.LoadLevel(0); } public void OnDisconnectedFromServer(NetworkRunner runner, NetDisconnectReason reason) { Debug.Log("OnDisconnectedFromServer: " + reason); Application.LoadLevel(0); + } public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason) { diff --git a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/playerManager.cs b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/playerManager.cs index 17b2748b..079368e8 100644 --- a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/playerManager.cs +++ b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/playerManager.cs @@ -46,6 +46,7 @@ public class playerManager : NetworkBehaviour if (Object.InputAuthority.PlayerId==Runner.LocalPlayer.PlayerId) { PlayerId = EN.instance.SelectedUser.id.ToString(); + Nickname = EN.instance.Me.first_name + " " + EN.instance.Me.last_name; RPC_SetPlayerName(PlayerId.Value); } // if(Object.HasInputAuthority) @@ -62,7 +63,7 @@ public class playerManager : NetworkBehaviour else transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/back").GetComponent().color= speaker.IsPlaying?Color.green:Color.grey; transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/back1").GetComponent().color= speaker.IsPlaying?Color.green:Color.grey; - transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/name").GetComponent().text = EN.instance.users[Id].first_name+" " + EN.instance.users[Id].last_name; + transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/name").GetComponent().text = Nickname.ToString(); for (int i = 0; i < EN.instance.users.Count; i++) if (transform.Find(i.ToString())) if (i != Id) @@ -94,7 +95,16 @@ public class playerManager : NetworkBehaviour [Networked] public NetworkString<_16> PlayerId { get; set; } // نام کاربر با حداکثر 16 کاراکتر + [Networked, OnChangedRender(nameof(NicknameChanged))] + public NetworkString<_32> Nickname { get; set; } + private void NicknameChanged() + { + if (transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/name")) + { + transform.Find("Headset/HeadsetVisuals/PhotonDummy/board/name").GetComponent().text = Nickname.ToString(); + } + } [Rpc(RpcSources.All, RpcTargets.All)] public void RPC_SetPlayerName(string id) diff --git a/Assets/Plugins/ReadyPlayerMe.meta b/Assets/Plugins/ReadyPlayerMe.meta new file mode 100644 index 00000000..8e38f5e9 --- /dev/null +++ b/Assets/Plugins/ReadyPlayerMe.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 346755686f23bf34595f19c165bbdbe0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/ReadyPlayerMe/WebGLHelper.meta b/Assets/Plugins/ReadyPlayerMe/WebGLHelper.meta new file mode 100644 index 00000000..cf7311de --- /dev/null +++ b/Assets/Plugins/ReadyPlayerMe/WebGLHelper.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed793e7d3865d47ce8f3db68c1874e0c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib b/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib new file mode 100644 index 00000000..94a1ad4c --- /dev/null +++ b/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib @@ -0,0 +1,19 @@ +mergeInto(LibraryManager.library, { + + ShowReadyPlayerMeFrame: function () { + showRpm(); + }, + + HideReadyPlayerMeFrame: function () { + hideRpm(); + }, + + SetupRpm: function (url, targetGameObjectName){ + setupRpmFrame(UTF8ToString(url), UTF8ToString(targetGameObjectName)); + }, + + ReloadUrl: function (url){ + reloadUrl(UTF8ToString(url)); + } + +}); \ No newline at end of file diff --git a/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib.meta b/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib.meta new file mode 100644 index 00000000..1dc37ab6 --- /dev/null +++ b/Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib.meta @@ -0,0 +1,83 @@ +fileFormatVersion: 2 +guid: 8341ba44d96cd40a9b5a0963cd2c23d4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 1 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 0 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Plugins/ReadyPlayerMe/WebGLHelper/RpmWebGLHelper.jslib + uploadId: 704624 diff --git a/Assets/Prefabs/GlbDownloader.prefab b/Assets/Prefabs/GlbDownloader.prefab new file mode 100644 index 00000000..4fb6b2b5 --- /dev/null +++ b/Assets/Prefabs/GlbDownloader.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dba9abaa81b49772afecd57a7bdd741329b83bfafbec04e160b8647736bf3330 +size 1926 diff --git a/Assets/Prefabs/GlbDownloader.prefab.meta b/Assets/Prefabs/GlbDownloader.prefab.meta new file mode 100644 index 00000000..710b775b --- /dev/null +++ b/Assets/Prefabs/GlbDownloader.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 155af7b2dadaf094a83ba586de85efb9 +labels: +- FusionPrefab +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Network.meta b/Assets/Prefabs/Network.meta new file mode 100644 index 00000000..069878d2 --- /dev/null +++ b/Assets/Prefabs/Network.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb05a1bfd5c45c5449a8641d13dee884 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/VRCharacter.prefab b/Assets/Prefabs/VRCharacter.prefab index 1b0deb34..ed393c7e 100644 --- a/Assets/Prefabs/VRCharacter.prefab +++ b/Assets/Prefabs/VRCharacter.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b8fbc562b120e6172abc3f27a80bbc4ed5d900cc90d6276ad38fa5433b6f4ec2 -size 474726 +oid sha256:a28311b6d7fcc750b33670c2f110a4aafecb3329ee28937aa25fb1c92d2b25fe +size 476009 diff --git a/Assets/Prefabs/mgroom.fbx b/Assets/Prefabs/mgroom.fbx new file mode 100644 index 00000000..5289ec45 --- /dev/null +++ b/Assets/Prefabs/mgroom.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f5da3f77c18aa759920894176d8e80344ce498fff6ef7224ca57e08881b9910 +size 60139324 diff --git a/Assets/Prefabs/mgroom.fbx.meta b/Assets/Prefabs/mgroom.fbx.meta new file mode 100644 index 00000000..3b858ef6 --- /dev/null +++ b/Assets/Prefabs/mgroom.fbx.meta @@ -0,0 +1,107 @@ +fileFormatVersion: 2 +guid: 2c6343d6ccb674043a21a77511a4b9e2 +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars.meta b/Assets/Ready Player Me/Avatars.meta new file mode 100644 index 00000000..55f38430 --- /dev/null +++ b/Assets/Ready Player Me/Avatars.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10279eb9fd749a74a90b3cfce7fd84cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047.meta b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047.meta new file mode 100644 index 00000000..48f264d9 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1c3b5bf707de8b48a755d6d05cb2f28 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json new file mode 100644 index 00000000..f41f8671 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json @@ -0,0 +1 @@ +{"BodyType":"halfbody","OutfitGender":1,"UpdatedAt":"2025-05-12T10:37:27.051Z","SkinTone":"#e3967d"} \ No newline at end of file diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json.meta b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json.meta new file mode 100644 index 00000000..b741a4b2 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/6821cf26b09411ec7bf64047.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0311ab2b2737f0546b4e941397027cbc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8.meta b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8.meta new file mode 100644 index 00000000..53536e54 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b05cd0608b542dd46898cb10deeda23d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb new file mode 100644 index 00000000..581e238b --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2b5c502808bfdc75c3a7234e686f068965c032a4eed7c2b1513eb2ea94c99ff +size 1123472 diff --git a/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb.meta b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb.meta new file mode 100644 index 00000000..61f2b3ec --- /dev/null +++ b/Assets/Ready Player Me/Avatars/6821cf26b09411ec7bf64047/b511e1b030a4981015ba42a9a0a8cbf8/6821cf26b09411ec7bf64047.glb.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: 076415b74b4e8bb4890efd0b73c3ee9f +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 715df9372183c47e389bb6e19fbc3b52, type: 3} + editorImportSettings: + generateSecondaryUVSet: 0 + importSettings: + nodeNameMethod: 1 + animationMethod: 2 + generateMipMaps: 1 + texturesReadable: 0 + defaultMinFilterMode: 9729 + defaultMagFilterMode: 9729 + anisotropicFilterLevel: 1 + instantiationSettings: + mask: -1 + layer: 0 + skinUpdateWhenOffscreen: 1 + lightIntensityFactor: 1 + sceneObjectCreation: 2 + assetDependencies: [] + reportItems: [] diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9.meta b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9.meta new file mode 100644 index 00000000..f6e09381 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dca145dc0aa5f184784ec4a296357b77 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json new file mode 100644 index 00000000..5f0a82fa --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json @@ -0,0 +1 @@ +{"BodyType":"halfbody","OutfitGender":1,"UpdatedAt":"2025-05-26T10:52:24.93Z","SkinTone":"#be8677"} \ No newline at end of file diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json.meta b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json.meta new file mode 100644 index 00000000..f94f5063 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/682c2236eb70e258ab860cb9.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a5bddd18d17f1ef49b86a873ee9bb803 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8.meta b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8.meta new file mode 100644 index 00000000..1588088a --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b8bf5c51e186bd4784eb5c1c2be851b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb new file mode 100644 index 00000000..4e27897b --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82532944fa71a22c61ad86e00949f1576f2689e93dc800663fab910329aa1910 +size 1440836 diff --git a/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb.meta b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb.meta new file mode 100644 index 00000000..eac8b171 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/682c2236eb70e258ab860cb9/b511e1b030a4981015ba42a9a0a8cbf8/682c2236eb70e258ab860cb9.glb.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: 35870c4b13047bc4aaf2826b10da6dfa +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 715df9372183c47e389bb6e19fbc3b52, type: 3} + editorImportSettings: + generateSecondaryUVSet: 0 + importSettings: + nodeNameMethod: 1 + animationMethod: 2 + generateMipMaps: 1 + texturesReadable: 0 + defaultMinFilterMode: 9729 + defaultMagFilterMode: 9729 + anisotropicFilterLevel: 1 + instantiationSettings: + mask: -1 + layer: 0 + skinUpdateWhenOffscreen: 1 + lightIntensityFactor: 1 + sceneObjectCreation: 2 + assetDependencies: [] + reportItems: [] diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571.meta new file mode 100644 index 00000000..82d3589e --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1106b4e1a5216214ab3042083da7f96c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934.meta new file mode 100644 index 00000000..4a2fcfa7 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f3a46d8fb4354a34cbb6eb5d2cc42441 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb new file mode 100644 index 00000000..f18fae9d --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a34e0eece8f6d68929f96456f1dff3a83fcf80687eaea7a8db03e1dbc7a93f60 +size 912436 diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb.meta new file mode 100644 index 00000000..44e0f452 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.glb.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: d0fb729eb85f4294292f6d3c1bc47c46 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 715df9372183c47e389bb6e19fbc3b52, type: 3} + editorImportSettings: + generateSecondaryUVSet: 0 + importSettings: + nodeNameMethod: 1 + animationMethod: 2 + generateMipMaps: 1 + texturesReadable: 0 + defaultMinFilterMode: 9729 + defaultMagFilterMode: 9729 + anisotropicFilterLevel: 1 + instantiationSettings: + mask: -1 + layer: 0 + skinUpdateWhenOffscreen: 1 + lightIntensityFactor: 1 + sceneObjectCreation: 2 + assetDependencies: [] + reportItems: [] diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab new file mode 100644 index 00000000..fb3159c8 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29a4b6b0da579d52e0c4e1a8648263fb9535af115a4c9d814db7ca211300c0e9 +size 67556 diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab.meta new file mode 100644 index 00000000..7524672c --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/2fac66e374c947c41bc74325c6e3d934/683447e488188a3a9b8bd571.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c8606b2f8cb405b4288f4f569326083d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json new file mode 100644 index 00000000..ca9eeec9 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json @@ -0,0 +1 @@ +{"BodyType":"halfbody","OutfitGender":1,"UpdatedAt":"2025-05-26T10:52:24.937Z","SkinTone":"#c37c5f"} \ No newline at end of file diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json.meta new file mode 100644 index 00000000..59fcfc7a --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/683447e488188a3a9b8bd571.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5410dc4a1e236d64898cb0e15a399252 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8.meta new file mode 100644 index 00000000..fdc7e20a --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f3db13d807a7d7c4491e9a2d8e648a6a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb new file mode 100644 index 00000000..848e7d86 --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e445bf116b610eeed6eb69a967fee63b5b40a10f41cf5000aaae4bc0cb28a6a3 +size 1297600 diff --git a/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb.meta b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb.meta new file mode 100644 index 00000000..c54cfdde --- /dev/null +++ b/Assets/Ready Player Me/Avatars/683447e488188a3a9b8bd571/b511e1b030a4981015ba42a9a0a8cbf8/683447e488188a3a9b8bd571.glb.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: cba335808e7e3d04190758939bff9d0d +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 715df9372183c47e389bb6e19fbc3b52, type: 3} + editorImportSettings: + generateSecondaryUVSet: 0 + importSettings: + nodeNameMethod: 1 + animationMethod: 2 + generateMipMaps: 1 + texturesReadable: 0 + defaultMinFilterMode: 9729 + defaultMagFilterMode: 9729 + anisotropicFilterLevel: 1 + instantiationSettings: + mask: -1 + layer: 0 + skinUpdateWhenOffscreen: 1 + lightIntensityFactor: 1 + sceneObjectCreation: 2 + assetDependencies: [] + reportItems: [] diff --git a/Assets/Ready Player Me/Core.meta b/Assets/Ready Player Me/Core.meta new file mode 100644 index 00000000..affcd107 --- /dev/null +++ b/Assets/Ready Player Me/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: accc2378d3ac4f0448f2233c05d3e15a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/CHANGELOG.md b/Assets/Ready Player Me/Core/CHANGELOG.md new file mode 100644 index 00000000..55b61181 --- /dev/null +++ b/Assets/Ready Player Me/Core/CHANGELOG.md @@ -0,0 +1,472 @@ +# Changelog + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [7.3.1] - 2024.10.30 + +## Updated +- Re-exporting package for asset store with updated dependencies + +## [7.3.0] - 2024.10.22 + +## Updated +- auth-related requests now use auth-service endpoints [#317](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/317) +- updated shader variants to fix issues various material issues + +## Fixed +- Fixed an issue causing Out of Bounds exception in WebGL voice handler [#322](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/322) + +## Added +- DestroyMesh class can be used to destroy manually destroy mesh, materials and textures to prevent memory leaks + +## [7.2.0] - 2024.09.06 + +## Updated +- Updated handling of response data to reduce garbage allocation [#314](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/314) +## Fixed +- Preserve AssetId property in IAssetData [#313](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/313) + +## [7.1.1] - 2024.07.25 + +## Fixed +- Fixed an issue causing json parsing to fail on iFrame events [#311](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/311/) + +## [7.1.0] - 2024.07.16 + +## Updated +- Reworked shader overrides to support mapping of other property types [#306](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/306) + +## Fixed +- Fixed an issue caused by missing bones on avatar template prefabs [#310](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/310/) + +## [7.0.0] - 2024.07.01 + +## Updated + +- Loading circle animation now using MMecanim animation [#302](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/302) +- Removed unnecessary assets from Resources folder [#303](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/303) +- Updated Template avatar assets [#300](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/300) +- Avatar Body type now moved to CoreSettings [#290](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/290) + +### Added + +- Added support for hero customization assets (costumes) [#301](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/301) +- Templates can now be filtered by Bodytype [#296](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/296) + +### Fixed + +- Fixed an issue causing invalid load settings in Avatar Loader window [#298](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/298) + +## [6.3.1] - 2024.06.18 + +### Fixed + +- Allow cache to be loaded from previous versions, where bodyType was stored as an integer [#293](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/293) + +## [6.3.0] - 2024.06.11 + +### Updated + +- XR animation avatars now have DOF enabled by default [#288](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/288) +- Updated InCreatorAvatarLoader to use avatar config [#286](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/286) +- Avatar Creator Icon categories updated [#272](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/272) + +### Fixed + +- Fixed an issue preventing LOD's from updating [#277](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/277) +- An issue causing multiple signup requests [#275](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/275) + +### Added +- Avatar template type filter [#270](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/270) +- Handle failed body shape requests [#281](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/281) +- Option to filter Templates by gender [#273](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/273) + +## [6.2.4] - 2024.05.03 + +### Fixed + +- Updated XR template prefab meshes to prevent missing bone references to fix mesh transfer [#266](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/266) + +## [6.2.3] - 2024.04.29 + +### Fixed + +- Reverted update to GetMeshRenderer method [#264](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/264) + +## [6.2.2] - 2024.04.29 + +### Updated + +- Updated XR template avatar to have separated head mesh [#261](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/261) +- Improved GetMeshRenderer() method to exclude invalid mesh renderers [#261](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/261) + +### Fixed + +- Fixed issue with XR animation avatars + +## [6.2.1] - 2024.04.23 + +### Fixed + +- An issue with gender and avatarID not to be set in AvatarManager [#260](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/260) + +## [6.2.0] - 2024.04.22 + +### Added + +- XR template avatar added to the Resources folder [#258](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/258) +- Avatar Creator now supports body shapes [#252](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/252) +- support for unknown exceptions [#251](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/251) +- Simple PanelManager script +- Optional define symbol to remove camera permissions from the Android manifest [#259](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/259) + +## Updated + +- Removed use of tuples and deprecated old methods [#257](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/257) + +## [6.1.2] - 2024.04.03 + +### Updated + +- XR animation avatars updated to support with latest xr avatar updates + +## [6.1.1] - 2024.04.03 + +### Updated + +- Avatars done with a photo are now added as a draft avatars [#254](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/254) + +## [6.1.0] - 2024.03.04 + +### Updated +- AvatarMeshHelper now supports multiple mesh and material transfer. [#241](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/241) + +### Added +- GetHeadMeshes method to AvatarMeshHelper to get head related meshes from an avatar. [#242](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/242) +- Template avatar with all possible meshes is added to the Resources folder. + +## [6.0.1] - 2024.02.26 + +### Updated + +- Updated default render settings to fix an issue causing incorrect halfbody avatar renders [#238](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/238) + +## [6.0.0] - 2024.02.19 + +### Updated + +- **BREAKING: Renamed Avatar Create Samples** [#210](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/210) _This change +may require updates to existing references in your projects._ +- Small fix for button icon resizing [#215](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/215) +- LoginWithCode can now merge avatars into RPM account [#219](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/219) +- Recover hair when headwear is removed [#224](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/224) +- Added extra check to prevent settings override [#226](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/226) + +### Added + +- Logout Element for Avatar Creator [#216](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/216) +- New iFrame Events to WebFrameHandler [#212](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/212) +- Added support for XR Avatar skeleton [#217](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/217) +- Added Avatar List element [#218](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/218) +- Account creation and login elements in Avatar Creator sample [#230](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/230) + +### Removed + +- Quickstart Parameter from UrlConfig [#221](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/221) +- Selfie to Avatar Element* [#220](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/220) +- Removed WebView auto installation [#208](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/208) + +## [5.0.0] - 2024.01.12 + +### Updated + +- Refactor and extracted shared logic from network + packages [#148](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/148) +- Replaced api urls in samples with models urls [#152](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/152) +- Added com.unity.cloud.gltfast as a dependency and removed auto install of gltfast from git + url [#155](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/155) +- Updated to GLTFast 6.0.1 [#157](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/157) +- Replaced use of ienumerator coroutines with + async/await [#172](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/172) +- Request class names updated to be more uniform [#173](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/173) +- Endpoint classes removed and refactored [#174](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/174) +- Added avatar creator POC sample using new + elements [#182](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/182) +- Removed "I don't have an account" checkbox from setup + guide [#184](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/184) +- Restructure of avatar creator samples [#185](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/185) +- Class and folder restructure to match Unity package + standards [#190](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/190) +- Namespaces added to some scripts to meet asset store + requirements [#195](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/195) +- Ready Player Me top toolbar menu is under `Tools/Ready Player Me` to comply with Asset Store + requirements [#195](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/195) +- Samples renamed for Asset Store version of package and paths updated + accordingly [#198](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/198) +- Quick start sample animations updated [#200](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/200) +- Draco compression package version updated [#202](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/202) + +### Added + +- Add gender select element for Avatar Creator [#159](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/159) +- Basic login element for Avatar Creator [#160](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/160) +- Photo capture element for Avatar Creator [#162](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/162) +- Avatar template element for Avatar Creator [#164](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/164) +- Selfie element for Avatar Creator [#166](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/166) +- Asset panel element for Avatar Creator [#175](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/175) +- Account creation element for Avatar Creator [#178](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/178) +- Avatar preview element for Avatar Creator [#181](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/181) + +- Fixed some issues related to paths like in the Graphics Setting + Utility [#195](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/195) +- Shader override property added to avatar config [#199](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/199) + +### Fixed + +- Fix for handling pasted url text in subdomain + field [#183](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/183) +- Added permission and orientation fix to photo capture + element [#192](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/192) +- Added Panel Switcher clear functionality to fix issues related to relaunching the + Creator [#194](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/194) +- Namespaces added to some scripts to meet asset store + requirements [#195](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/195) + +## [4.1.2] - 2023.12.20 + +### Fixed + +- Add preserve attribute to CategoryConverter in + AvatarCreator [#193](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/193) + +## [4.1.1] - 2023.11.29 + +### Fixed + +- Fixed json converters in AvatarCreator getting stripped on android or webgl + builds [#188](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/188) + +## [4.1.0] - 2023.11.29 + +### Updated + +- Replaced API URLs with model URLs for shortcodes [#152](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/152) +- Updated render api and samples [#147](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/147) + +### Added + +- Added app id to setup guide [#145](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/145) + +## [4.0.1] - 2023.11.14 + +### Fixed + +- Fixed an issue causing avatars to be stored locally even if caching was + disabled [#150](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/150) + +## [4.0.0] - 2023.11.01 + +### Breaking Changes + +- Merge avatar creator into core [#135](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/135). +- AvatarProcessor no longer searches and replaces existing + avatar [#138](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/138) + +### Added + +- Show Avatar Creator sample button in guide [#141](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/141) + +### Updated + +- Merged related samples into single folders [#139](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/139) + +## [3.4.0] - 2023.10.24 + +### Added + +- Breaking change popup [#136](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/136) + +### Updated + +- Disable use demo toggle in setup guide [#131](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/131) +- Refactor define symbol add and remove logic [#133](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/133) + +## [3.3.0] - 2023.10.05 + +### Added + +- Moved core iframe and url logic from WebView + package [#125](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/125) + +### Updated + +- Refactored core settings handler [#124](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/124) +- Centred all editor window content [#122](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/122) + +## [3.2.4] - 2023.09.28 + +### Fixed + +- An issue causing WebView to be auto imported if + removed [#126](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/126) + +## [3.2.3] - 2023.09.11 + +### Fixed + +- An issue causing settings to be recreated when not + needed [#123](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/123) + +## [3.2.2] - 2023.09.07 + +### Fixed + +- An issue with module installer causing errors when importing on some Windows + machines [#117](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/117) + +## [3.2.1] - 2023.08.28 + +### Fixed + +-Issue of missing mesh references when prefabs were created by avatar loader + window [#109](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/109) + +## [3.2.0] - 2023.08.24 + +### Added + +- App Id is added to header of all web requests + +### Fixed + +- GLTF scripting define symbol not getting assigned + +## [3.1.1] - 2023.08.11 + +### Fixed + +- Fixed an issue causing analytics events being sent to development + environment [#102](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/102) +- Re-added RPM define symbol required for supporting + packages [#102](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/102) + +## [3.1.0] - 2023.08.08 + +### Added + +* Personal avatar loading in quick start https://github.com/readyplayerme/rpm-unity-sdk-core/pull/97 +* Runtime analytics to quick start https://github.com/readyplayerme/rpm-unity-sdk-core/pull/98 + +## [3.0.0] - 2023.07.31 + +### Added + +- **BREAKING: All scripts and assets from Avatar + Loader** [#87](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/87) +- Module installer now automatically removes Avatar Loader after + update [#89](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/89) +- New Integration guide editor window [#91](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/91) + +### Removed + +- **BREAKING: all references to ReadyPlayerMe.AvatarLoader namespace** [#87](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/87) + +### Updated + +- Moved GltFast dependent code behind scripting define + symbol [#87](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/87) +- Avatar config processor now uses new mesh LOD + parameter [#90](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/90) +- Setup guide window improvements [#91](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/91) + +## [1.3.0] - 2023.05.29 + +### Added + +- Import timeout to module installer [#70](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/70) +- Add new setup guide window [#71](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/71) +- Added function for folder size in MB [#72](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/72) + +### Fixed + +- Various editor window layout fixes [#73](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/73) + +## [1.2.0] - 2023.04.18 + +### Added + +- Support for response codes [#62](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/62) + +### Updated + +- Refactor of WebRequestDispatcher [#59](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/59) + +### Fixed + +- Fixed an issue with the popup don't ask again pref was not updating + correctly [#58](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/58) + +## [1.1.0] - 2023.03.21 + +### Added + +- Quick start sample popup +- Added operation completed event +- Discussion link to README.md + +### Updated + +- OpenUPM installation added to README.md + +## [1.0.0] - 2023.02.20 + +### Added + +- Optional sdk logging +- Don't ask again option for update check + +### Updated + +- PartnerSubdomainSettings refactored to a CoreSettings scriptable object + +### Fixed + +- Core settings asset now automatically created if it is missing +- Various bug fixes and improvements + +## [0.2.0] - 2023.02.08 + +### Added + +- Optional sdk logging + +### Updated + +- PartnerSubdomainSettings refactored to a CoreSettings scriptable object + +### Fixed + +- Various bug fixes and improvements + +## [0.1.0] - 2023.01.22 + +### Updated + +- Repository names in module list + version numbers + +## [0.1.0] - 2023.01.12 + +### Added + +- Inline code documentation +- Contribution guide and code of conduct +- Module installer and updater for handling package installation + +### Updated + +- A big refactor of code and classes + +### Fixed + +- Various bug fixes and improvements diff --git a/Assets/Ready Player Me/Core/CHANGELOG.md.meta b/Assets/Ready Player Me/Core/CHANGELOG.md.meta new file mode 100644 index 00000000..5fa37290 --- /dev/null +++ b/Assets/Ready Player Me/Core/CHANGELOG.md.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7a3e4746243f04549af24f9f9eca1f06 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/CHANGELOG.md + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md b/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..9ce57352 --- /dev/null +++ b/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md @@ -0,0 +1,80 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@readyplayer.me. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at . + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at . Translations are available at . \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md.meta b/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md.meta new file mode 100644 index 00000000..025c0d2f --- /dev/null +++ b/Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7879103106cd18d47b36fbbd7faf0b2c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/CODE_OF_CONDUCT.md + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/CONTRIBUTING.md b/Assets/Ready Player Me/Core/CONTRIBUTING.md new file mode 100644 index 00000000..0d7242a7 --- /dev/null +++ b/Assets/Ready Player Me/Core/CONTRIBUTING.md @@ -0,0 +1,136 @@ +# Welcome to the Ready Player Me Unity SDK (Core) contributing guide + +Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on [https://github.com/readyplayerme/Unity-Core](https://github.com/readyplayerme/Unity-Core) :sparkles:. + +Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable. + +In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR. + +Use the table of contents icon on the top left corner of this document to get to a specific section of this guide quickly. + + +## New contributor guide + +To get an overview of the project, read the [README](README.md). Here are some resources to help you get started with open source contributions: + +- [FAQ](#faq) +- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git) +- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow) +- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests) +- [Code style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md) + + +## FAQ + +#### **Did you find a bug?** + +* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/readyplayerme/Unity-core/issues). + +* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/readyplayerme/Unity-core/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. + +* If possible, use the relevant bug report templates to create the issue. Simply copy the content of the appropriate template into a .rb file, make the necessary changes to demonstrate the issue, and **paste the content into the issue description**: + * [**Generic template** for other issues](https://github.com/readyplayerme/Unity-Core/blob/develop/.github/pull_request_template.md) + +* If you would like to contact us directly to report an issue or for general support requests contact our Ready Player Me Support email [support@readyplayer.me](mailto:support@readyplayer.me). + +#### **Did you write a patch that fixes a bug?** + +* Open a new GitHub pull request with the patch. + +* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. + +* Before submitting, please read the [Contributing to Ready Player Me Unity SDK](#) guide to know more about our coding conventions and best practices. + +#### **Did you fix whitespace, format code, or make a purely cosmetic patch?** + +Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability will generally not be accepted. + +#### **Do you intend to add a new feature or change an existing one?** + +* Suggest your change to the Ready Player Me support email [support@readyplayer.me](mailto:support@readyplayer.me) and start writing code. + +* **Do not open an issue on GitHub** until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes. + +#### **Do you have questions about the source code?** + +* Ask any question about how to use the Ready Player Me Unity SDK in the [Ready Player Me support email](mailto:support@readyplayer.me). + +## Issues + +#### Create a new issue + +If you spot a problem with the docs, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/github/docs/issues/new/choose). + +#### Solve an issue + +Scan through our [existing issues](https://github.com/github/docs/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See [Labels](/contributing/how-to-use-labels.md) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. + +### Make Changes + +#### Make changes locally + + +1. [Install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage). + +2. Fork the repository. +- Using GitHub Desktop: + - [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop. + - Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)! + +- Using the command line: + - [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them. + +4. Create a working branch and start with your changes! + +### Commit your update + +We encourage following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format when it comes to writing commit messages. Our package repositories come with a .githooks folder that has a commit-msg file that can enforce this. +To set this up you just need to configure git's hookspath folder to point there. + +You can do this by +1. Open the terminal +2. Navigate to the root folder of this repository +3. Run the following command + `git config core.hooksPath .githooks` + +Commit the changes once you are happy with them. Don't forget to [self-review](#self-review) to speed up the review process:zap:. + +### Self review + +You should always review your own PR first. + +For content changes, make sure that you: + +- [ ] Confirm that the changes meet the user experience and goals outlined in the content design plan (if there is one). +- [ ] Compare your pull request's source changes to staging to confirm that the output matches the source and that everything is rendering as expected. This helps spot issues like typos, content that doesn't follow the [style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md), or content that isn't rendering due to versioning problems. Remember that lists and tables can be tricky. +- [ ] Review the content for technical accuracy. +- [ ] Review the entire pull request using the [translations guide for writers](./translations/for-writers.md). +- [ ] Copy-edit the changes for grammar, spelling, and adherence to the [style guide](https://github.com/readyplayerme/rpm-unity-sdk-core/blob/main/style-guidelines.md). +- [ ] Check new or updated Liquid statements to confirm that versioning is correct. +- [ ] If there are any failing checks in your PR, troubleshoot them until they're all passing. + + +### Pull Request + +When you're finished with the changes, create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). +- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request. +- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one. +- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge. +Once you submit your PR, a team member will review your proposal. We may ask questions or request additional information. +- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. +- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). +- If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues. + +### Your PR is merged! + +Congratulations :tada::tada: The GitHub team thanks you :sparkles:. + +Once your PR is merged, your contributions will be publicly visible on the [GitHub docs](https://docs.github.com/en). + +Now that you are part of the GitHub docs community, see how else you can [contribute to the docs](/contributing/types-of-contributions.md). + + + +Thanks! :heart: :heart: :heart: + +Ready Player Me Team \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/CONTRIBUTING.md.meta b/Assets/Ready Player Me/Core/CONTRIBUTING.md.meta new file mode 100644 index 00000000..35c1cb93 --- /dev/null +++ b/Assets/Ready Player Me/Core/CONTRIBUTING.md.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: a9911f547d3809f45a65e24379e1e2a0 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/CONTRIBUTING.md + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor.meta b/Assets/Ready Player Me/Core/Editor.meta new file mode 100644 index 00000000..be8527c6 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93849b2d974237746812c1d8407d660a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/AvatarCreator.meta b/Assets/Ready Player Me/Core/Editor/AvatarCreator.meta new file mode 100644 index 00000000..1c1296fe --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/AvatarCreator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3cd7b15d18039474489020dd9d3daf34 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs b/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs new file mode 100644 index 00000000..33667484 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace ReadyPlayerMe.AvatarCreator.Editor +{ + [CustomPropertyDrawer(typeof(AssetTypeFilterAttribute))] + public class AssetTypeFilterDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + var assetTypeAttribute = attribute as AssetTypeFilterAttribute; + + if (property.propertyType == SerializedPropertyType.Enum) + { + EditorGUI.BeginProperty(position, label, property); + + EditorGUI.BeginChangeCheck(); + + // Get the current enum value + var currentEnumValue = (AssetType) property.enumValueIndex; + + var filteredEnumNames = new List(); + foreach (var enumName in Enum.GetNames(typeof(AssetType))) + { + var enumFieldInfo = typeof(AssetType).GetField(enumName); + var enumAttribute = (AssetTypeFilterAttribute) Attribute.GetCustomAttribute(enumFieldInfo, typeof(AssetTypeFilterAttribute)); + if (enumAttribute == null) continue; + + var filter = (AssetFilter) Enum.Parse(typeof(AssetFilter), enumAttribute.filter.ToString()); + if (filter == assetTypeAttribute?.filter) + { + filteredEnumNames.Add(enumName); + } + } + + // Display the dropdown with filtered enum values + var newIndex = EditorGUI.Popup(position, label.text, Array.IndexOf(filteredEnumNames.ToArray(), currentEnumValue.ToString()), filteredEnumNames.ToArray()); + + // Set the new enum value if it has changed + if (EditorGUI.EndChangeCheck()) + { + property.enumValueIndex = (int) Enum.Parse(typeof(AssetType), filteredEnumNames[newIndex]); + } + + EditorGUI.EndProperty(); + } + else + { + EditorGUI.LabelField(position, label.text, "Use AssetType with Enum."); + } + } + + } +} diff --git a/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs.meta b/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs.meta new file mode 100644 index 00000000..8f5bc16d --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6add29e0a6c64d6786c6742dfbd87acf +timeCreated: 1702392584 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/AvatarCreator/AssetTypeFilterDrawer.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef b/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef new file mode 100644 index 00000000..0e3cbfd4 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef @@ -0,0 +1,19 @@ +{ + "name": "ReadyPlayerMe.AvatarCreator.Editor", + "rootNamespace": "", + "references": [ + "ReadyPlayerMe.Core", + "ReadyPlayerMe.AvatarCreator" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef.meta b/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef.meta new file mode 100644 index 00000000..7d04ba4e --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 0ed01c010d356f94b99818818dbd9430 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/AvatarCreator/ReadyPlayerMe.AvatarCreator.Editor.asmdef + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core.meta b/Assets/Ready Player Me/Core/Editor/Core.meta new file mode 100644 index 00000000..291287ee --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 17b21c922120b25458033294675f03ec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Resources.meta b/Assets/Ready Player Me/Core/Editor/Core/Resources.meta new file mode 100644 index 00000000..7c9c929a --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15d9bb0049cd8b245900c3f74fc99cb0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png b/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png new file mode 100644 index 00000000..d3d93be2 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7a21ba098b362755c6861b149f35e4ea318dd217f18bb897da15fc7ac287936 +size 11932 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png.meta b/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png.meta new file mode 100644 index 00000000..2385c38a --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: 97cb8e496ac634f4ba4c0a1bb899c8da +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Resources/Banner.png + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png b/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png new file mode 100644 index 00000000..7b307bdd --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f703ba93f21b4cd25d1c87229e44f9b59ac63785efd632315aeb6e31208a3e3a +size 5434 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png.meta b/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png.meta new file mode 100644 index 00000000..67ee7be5 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 38a8827f446904c4c802c5b7850e3ff0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Resources/rpm_error_icon.png + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts.meta new file mode 100644 index 00000000..738e8066 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05e3bb89ec0ad464c9a480276df7c651 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics.meta new file mode 100644 index 00000000..02d2220b --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ac1c518000284e8ea25dfdd1284e0f16 +timeCreated: 1657013631 \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs new file mode 100644 index 00000000..22908025 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs @@ -0,0 +1,301 @@ +using System; +using System.Collections.Generic; +using ReadyPlayerMe.Core.Editor; +using UnityEditor; +using UnityEngine; +using static ReadyPlayerMe.Core.Analytics.Constants; + +namespace ReadyPlayerMe.Core.Analytics +{ + public class AmplitudeEditorLogger : IAnalyticsEditorLogger + { + private const string SDK_TARGET = "Unity"; + + private readonly Dictionary helpDataMap = new() + { + { HelpSubject.AvatarCaching, "avatar caching" }, + { HelpSubject.Subdomain, "subdomain" }, + { HelpSubject.AvatarConfig, "avatar config" }, + { HelpSubject.GltfDeferAgent, "gltf defer agent" }, + { HelpSubject.LoadingAvatars, "download avatar into scene" }, + { + HelpSubject.Avatars, "avatars body type" + } + }; + + private bool isEnabled; + private readonly AppData appData; + + public AmplitudeEditorLogger(bool isEnabled) + { + this.isEnabled = isEnabled; + appData = ApplicationData.GetData(); + } + + public void Enable() + { + isEnabled = true; + if (!AmplitudeEventLogger.IsSessionIdSet()) + { + GenerateSessionId(); + } + ToggleAnalytics(true); + } + + public void Disable() + { + ToggleAnalytics(false); + isEnabled = false; + AmplitudeEventLogger.SetSessionId(0); + } + + public void IdentifyUser() + { + if (!isEnabled) return; + if (!AmplitudeEventLogger.IsSessionIdSet()) + { + GenerateSessionId(); + } + SetUserProperties(); + } + + public void LogOpenProject() + { + if (!isEnabled) return; + GenerateSessionId(); + AmplitudeEventLogger.LogEvent(EventName.OPEN_PROJECT); + } + + public void LogCloseProject() + { + LogEvent(EventName.CLOSE_PROJECT); + } + + public void LogOpenDocumentation(string target) + { + LogEvent(EventName.OPEN_DOCUMENTATION, new Dictionary + { + { Properties.TARGET, target } + }); + } + + public void LogOpenFaq(string target) + { + LogEvent(EventName.OPEN_FAQ, new Dictionary + { + { Properties.TARGET, target } + }); + } + + public void LogOpenDiscord(string target) + { + LogEvent(EventName.OPEN_DISCORD, new Dictionary + { + { Properties.TARGET, target } + }); + } + + public void LogLoadAvatarFromDialog(string avatarUrl, bool eyeAnimation, bool voiceHandler) + { + LogEvent(EventName.LOAD_AVATAR_FROM_DIALOG, new Dictionary + { + { Properties.AVATAR_URL, avatarUrl }, + { Properties.EYE_ANIMATION, eyeAnimation }, + { Properties.VOICE_HANDLER, voiceHandler } + }); + } + + public void LogUpdatePartnerURL(string previousSubdomain, string newSubdomain) + { + LogEvent(EventName.UPDATED_PARTNER_URL, new Dictionary + { + { Properties.PREVIOUS_SUBDOMAIN, previousSubdomain }, + { Properties.NEW_SUBDOMAIN, newSubdomain } + }, new Dictionary + { + { Properties.SUBDOMAIN, newSubdomain } + }); + } + + public void LogOpenDialog(string dialog) + { + LogEvent(EventName.OPEN_DIALOG, new Dictionary + { + { Properties.DIALOG, dialog } + }); + } + + public void LogBuildApplication(string target, string appName, bool productionBuild) + { + LogEvent(EventName.BUILD_APPLICATION, new Dictionary + { + { Properties.TARGET, target }, + { Properties.APP_NAME, appName }, + { Properties.PRODUCTION_BUILD, productionBuild }, + { Properties.APP_IDENTIFIER, Application.identifier } + }); + } + + public void LogMetadataDownloaded(double duration) + { + LogEvent(EventName.METADATA_DOWNLOADED, new Dictionary + { + { Properties.DURATION, duration } + }); + } + + public void LogAvatarLoaded(double duration) + { + LogEvent(EventName.AVATAR_LOADED, new Dictionary + { + { Properties.DURATION, duration } + }); + } + + public void LogCheckForUpdates() + { + LogEvent(EventName.CHECK_FOR_UPDATES); + } + + public void LogSetLoggingEnabled(bool isLoggingEnabled) + { + LogEvent(EventName.SET_LOGGING_ENABLED, new Dictionary + { + { Properties.LOGGING_ENABLED, isLoggingEnabled } + }); + } + + public void LogSetCachingEnabled(bool isCachingEnabled) + { + LogEvent(EventName.SET_CACHING_ENABLED, new Dictionary + { + { Properties.CACHING_ENABLED, isCachingEnabled } + }); + } + + public void LogClearLocalCache() + { + LogEvent(EventName.CLEAR_LOCAL_CACHE); + } + + public void LogViewPrivacyPolicy() + { + LogEvent(EventName.PRIVACY_POLICY); + } + + public void LogShowInExplorer() + { + LogEvent(EventName.SHOW_IN_EXPLORER); + } + + public void LogFindOutMore(HelpSubject subject) + { + LogEvent(EventName.FIND_OUT_MORE, new Dictionary + { + { Properties.CONTEXT, helpDataMap[subject] } + }); + } + + public void LogOpenSetupGuide() + { + LogEvent(EventName.OPEN_SETUP_GUIDE); + } + + public void LogOpenIntegrationGuide() + { + LogEvent(EventName.OPEN_INTEGRATION_GUIDE); + } + + public void LogLoadQuickStartScene() + { + LogEvent(EventName.LOAD_QUICK_START_SCENE); + } + + public void LogOpenAvatarDocumentation() + { + LogEvent(EventName.OPEN_AVATAR_DOCUMENTATION); + } + + public void LogOpenAnimationDocumentation() + { + LogEvent(EventName.OPEN_ANIMATION_DOCUMENTATION); + } + + public void LogOpenAvatarCreatorDocumentation() + { + LogEvent(EventName.OPEN_AVATAR_CREATOR_DOCUMENTATION); + } + + public void LogOpenOptimizationDocumentation() + { + LogEvent(EventName.OPEN_OPTIMIZATION_DOCUMENTATION); + } + + public void LogAvatarCreatorSampleImported() + { + LogEvent(EventName.AVATAR_CREATOR_SAMPLE_IMPORTED); + } + + public void LogPackageInstalled(string id, string name) + { + LogEvent(EventName.INSTALL_PACKAGE, new Dictionary + { + { "id", id }, + { "name", name } + }); + } + + private void SetUserProperties() + { + var userProperties = new Dictionary + { + { Properties.SDK_SOURCE_URL, PackageManagerHelper.GetSdkPackageSourceUrl() }, + { Properties.ENGINE_VERSION, appData.UnityVersion }, + { Properties.RENDER_PIPELINE, appData.RenderPipeline }, + { Properties.SUBDOMAIN, appData.PartnerName }, + { Properties.APP_NAME, PlayerSettings.productName }, + { Properties.SDK_TARGET, SDK_TARGET }, + { Properties.APP_IDENTIFIER, Application.identifier }, + { Properties.ALLOW_ANALYTICS, true } + }; + + var modules = ModuleList.GetInstalledModuleVersionDictionary(); + + foreach (var module in modules) + { + userProperties.Add(module.Key, module.Value); + } + + LogEvent(EventName.SET_USER_PROPERTIES, null, userProperties); + } + + private void GenerateSessionId() + { + AmplitudeEventLogger.SetSessionId(DateTimeOffset.Now.ToUnixTimeMilliseconds()); + } + + private void ToggleAnalytics(bool allow) + { + LogEvent(EventName.ALLOW_ANALYTICS, new Dictionary + { + { Properties.ALLOW, allow } + }, new Dictionary + { + { Properties.ENGINE_VERSION, appData.UnityVersion }, + { Properties.RENDER_PIPELINE, appData.RenderPipeline }, + { Properties.SUBDOMAIN, appData.PartnerName }, + { Properties.APP_NAME, PlayerSettings.productName }, + { Properties.SDK_TARGET, "Unity" }, + { Properties.APP_IDENTIFIER, Application.identifier }, + { Properties.ALLOW_ANALYTICS, allow } + }); + } + + private void LogEvent(string eventName, Dictionary eventProperties = null, Dictionary userProperties = null) + { + if (!isEnabled) return; + + AmplitudeEventLogger.LogEvent(eventName, eventProperties, userProperties); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs.meta new file mode 100644 index 00000000..99211889 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ed6804cd2c9d4b9bb873a4c1cd6af062 +timeCreated: 1657032252 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs new file mode 100644 index 00000000..8db355d9 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs @@ -0,0 +1,31 @@ +using ReadyPlayerMe.Core.Editor; + +namespace ReadyPlayerMe.Core.Analytics +{ + public static class AnalyticsEditorLogger + { + public static readonly IAnalyticsEditorLogger EventLogger; + + static AnalyticsEditorLogger() + { + IsEnabled = CoreSettingsHandler.CoreSettings.EnableAnalytics; + EventLogger = new AmplitudeEditorLogger(IsEnabled); + } + + public static bool IsEnabled { get; private set; } + + public static void Enable() + { + IsEnabled = true; + EventLogger.Enable(); + CoreSettingsSetter.SetEnableAnalytics(true); + } + + public static void Disable() + { + EventLogger.Disable(); + IsEnabled = false; + CoreSettingsSetter.SetEnableAnalytics(false); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs.meta new file mode 100644 index 00000000..dffa1e5b --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fc2862cbf129461eaa91ca136d9d045d +timeCreated: 1658921992 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/AnalyticsEditorLogger.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs new file mode 100644 index 00000000..989f90e0 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs @@ -0,0 +1,74 @@ +namespace ReadyPlayerMe.Core.Analytics +{ + public static class Constants + { + public static class EventName + { + public const string OPEN_PROJECT = "open project"; + public const string OPEN_DOCUMENTATION = "open documentation"; + public const string OPEN_FAQ = "open faq"; + public const string OPEN_DISCORD = "open discord"; + public const string LOAD_AVATAR_FROM_DIALOG = "load avatar from dialog"; + public const string UPDATED_PARTNER_URL = "updated partner url"; + public const string ALLOW_ANALYTICS = "allow analytics"; + public const string OPEN_DIALOG = "open dialog"; + public const string BUILD_APPLICATION = "build application"; + public const string CLOSE_PROJECT = "close project"; + public const string METADATA_DOWNLOADED = "metadata downloaded"; + public const string AVATAR_LOADED = "avatar loaded"; + public const string SET_USER_PROPERTIES = "set user properties"; + public const string CLEAR_LOCAL_CACHE = "clear local cache"; + public const string SHOW_IN_EXPLORER = "show in explorer"; + public const string SET_LOGGING_ENABLED = "set logging enabled"; + public const string SET_CACHING_ENABLED = "set caching enabled"; + public const string CHECK_FOR_UPDATES = "check for updates"; + public const string PRIVACY_POLICY = "view privacy policy"; + public const string FIND_OUT_MORE = "find out more"; + public const string OPEN_SETUP_GUIDE = "open setup guide"; + public const string OPEN_INTEGRATION_GUIDE = "open integration guide"; + public const string LOAD_QUICK_START_SCENE = "load quick start scene"; + public const string OPEN_AVATAR_DOCUMENTATION = "open avatar documentation"; + public const string OPEN_ANIMATION_DOCUMENTATION = "open animation documentation"; + public const string OPEN_AVATAR_CREATOR_DOCUMENTATION = "open avatar creator documentation"; + public const string OPEN_OPTIMIZATION_DOCUMENTATION = "open optimization documentation"; + public const string AVATAR_CREATOR_SAMPLE_IMPORTED = "Avatar creator sample imported"; + public const string INSTALL_PACKAGE = "install unity package"; + } + + public static class Properties + { + public const string SDK_SOURCE_URL = "sdk source url"; + public const string ENGINE_VERSION = "engine version"; + public const string RENDER_PIPELINE = "render pipeline"; + public const string SUBDOMAIN = "subdomain"; + public const string APP_NAME = "app name"; + public const string SDK_TARGET = "sdk target"; + public const string TARGET = "target"; + public const string EYE_ANIMATION = "eye animation"; + public const string VOICE_HANDLER = "voice handler"; + public const string PREVIOUS_SUBDOMAIN = "previous subdomain"; + public const string NEW_SUBDOMAIN = "new subdomain"; + public const string ALLOW = "allow"; + public const string DIALOG = "dialog"; + public const string PRODUCTION_BUILD = "production build"; + public const string AVATAR_URL = "avatar url"; + public const string APP_IDENTIFIER = "app identifier"; + public const string ALLOW_ANALYTICS = "allow analytics"; + public const string DURATION = "duration"; + public const string LOGGING_ENABLED = "logging enabled"; + public const string CACHING_ENABLED = "caching enabled"; + public const string CONTEXT = "context"; + } + + public static class Links + { + public const string DOCS_PARTNERS_LINK = "https://docs.readyplayer.me/ready-player-me/what-is-ready-player-me#url"; + public const string DOCS_DEFER_AGENT_LINK = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/optimize/defer-agents"; + public const string DOCS_AVATAR_LOADER_WINDOW = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/avatar-loader-window"; + public const string DOCS_AVATAR_CONFIG_LINK = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/optimize/avatar-configuration"; + public const string DOCS_AVATAR_CACHING = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/optimize/avatar-caching"; + public const string AVATARS = "https://docs.readyplayer.me/ready-player-me/api-reference/avatars"; + public const string APP_ID = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/avatar-creator/custom-avatar-creator#prerequisites"; + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs.meta new file mode 100644 index 00000000..919fff08 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e7e6b1c7b30a462e971d46dd09b38bdf +timeCreated: 1657013679 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/Constants.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs new file mode 100644 index 00000000..ff514903 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs @@ -0,0 +1,12 @@ +namespace ReadyPlayerMe.Core.Analytics +{ + public enum HelpSubject + { + AvatarCaching, + Subdomain, + AvatarConfig, + GltfDeferAgent, + LoadingAvatars, + Avatars + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs.meta new file mode 100644 index 00000000..a0891a65 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 38767189f66d5bc4d8dfe76b552103f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/HelpSubject.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs new file mode 100644 index 00000000..2fbc2ef4 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs @@ -0,0 +1,36 @@ +namespace ReadyPlayerMe.Core.Analytics +{ + public interface IAnalyticsEditorLogger + { + void Enable(); + void Disable(); + void IdentifyUser(); + void LogOpenProject(); + void LogCloseProject(); + void LogOpenDocumentation(string target); + void LogOpenFaq(string target); + void LogOpenDiscord(string target); + void LogLoadAvatarFromDialog(string avatarUrl, bool eyeAnimation, bool voiceHandler); + void LogUpdatePartnerURL(string previousSubdomain, string newSubdomain); + void LogOpenDialog(string dialog); + void LogBuildApplication(string target, string appName, bool productionBuild); + void LogMetadataDownloaded(double duration); + void LogAvatarLoaded(double duration); + void LogCheckForUpdates(); + void LogSetLoggingEnabled(bool isLoggingEnabled); + void LogSetCachingEnabled(bool isCachingEnabled); + void LogClearLocalCache(); + void LogViewPrivacyPolicy(); + void LogShowInExplorer(); + void LogFindOutMore(HelpSubject subject); + void LogOpenSetupGuide(); + void LogOpenIntegrationGuide(); + void LogLoadQuickStartScene(); + void LogOpenAvatarDocumentation(); + void LogOpenAnimationDocumentation(); + void LogOpenAvatarCreatorDocumentation(); + void LogOpenOptimizationDocumentation(); + void LogAvatarCreatorSampleImported(); + void LogPackageInstalled(string id, string name); + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs.meta new file mode 100644 index 00000000..d0a1d543 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2a73e3153ee348d199f878b693a5e1f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Analytics/IAnalyticsEditorLogger.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions.meta new file mode 100644 index 00000000..9f93ab5d --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56a89e876009bc043b3211c63f594371 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs new file mode 100644 index 00000000..3c7b734a --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs @@ -0,0 +1,16 @@ +using System; +using System.Text.RegularExpressions; + +namespace ReadyPlayerMe.Core.Editor +{ + public static class StringExtensions + { + private const string SHORT_CODE_REGEX = "^[A-Z0-9]{6}$"; + + public static bool IsUrlShortcodeValid(this string urlString) + { + return !string.IsNullOrEmpty(urlString) && + (Regex.Match(urlString, SHORT_CODE_REGEX).Length > 0 || Uri.IsWellFormedUriString(urlString, UriKind.Absolute) && urlString.EndsWith(".glb")); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs.meta new file mode 100644 index 00000000..ef719b7f --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d58d3d8f33d435f4aa8b5b0b6625bcbb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Extensions/StringExtensions.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement.meta new file mode 100644 index 00000000..5169971c --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c882a7949df662b428444bc798c7ebb8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs new file mode 100644 index 00000000..06cc6426 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs @@ -0,0 +1,48 @@ +using System; +using ReadyPlayerMe.Core.Analytics; +using UnityEditor; + +namespace ReadyPlayerMe.Core.Editor +{ + /// + /// This class serves as a way of tracking when the Unity project (editor) is initially opened so that functions can be run at this point. + /// + [InitializeOnLoad] + public static class EntryPoint + { + private const string SESSION_STARTED_KEY = "SessionStarted"; + + /// Event for when package is imported or when project with package is opened. + public static Action Startup; + + /// + /// This constructor is used to subscribe to the event. + /// + static EntryPoint() + { + if (!SessionState.GetBool(SESSION_STARTED_KEY, false)) + { + SessionState.SetBool(SESSION_STARTED_KEY, true); + EditorApplication.update += Update; + } + } + + /// + /// This function is called on every Editor . + /// It is used to trigger moduleUpdater to check for updates when the Unity Project launches. + /// + private static void Update() + { + EditorApplication.update -= Update; + AnalyticsEditorLogger.EventLogger.LogOpenProject(); + AnalyticsEditorLogger.EventLogger.IdentifyUser(); + Startup?.Invoke(); + EditorApplication.quitting += OnQuit; + } + + private static void OnQuit() + { + AnalyticsEditorLogger.EventLogger.LogCloseProject(); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs.meta new file mode 100644 index 00000000..5a2df0dd --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 71bde74e39624415805f1552261fd75e +timeCreated: 1657016805 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/EntryPoint.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs new file mode 100644 index 00000000..ff01066c --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs @@ -0,0 +1,37 @@ +using System; + +namespace ReadyPlayerMe.Core.Editor +{ + /// + /// Structure ModuleInfo describes a Ready Player Me Module or Unity package. + /// + [Serializable] + public struct ModuleInfo + { + public string name; + public string gitUrl; + public string branch; + public string version; + + /// + /// Get the Unity package identifier. + /// + /// + /// A string representing the Unity packages Git Url including branch if specified. Returns module name if + /// gitUrl is not set. + /// + public string Identifier + { + get + { + if (gitUrl == string.Empty) + { + return name; + } + // if branch not set, default to the version in ModuleList + return gitUrl + (string.IsNullOrEmpty(branch) ? $"#v{version}" : $"#{branch}"); + + } + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs.meta new file mode 100644 index 00000000..58ddaa25 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f14ac780c523d32408d7ea9c6f78e692 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInfo.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs new file mode 100644 index 00000000..681532fd --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using UnityEditor; +using UnityEditor.Compilation; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; +using PackageInfo = UnityEditor.PackageManager.PackageInfo; + +namespace ReadyPlayerMe.Core.Editor +{ + /// + /// Class ModuleInstaller is responsible for checking and installing all modules (Unity packages) required for + /// the Ready Player Me Unity SDK from their Git URL's. + /// + [InitializeOnLoad] + public static class ModuleInstaller + { + private const string TAG = nameof(ModuleInstaller); + private const int THREAD_SLEEP_TIME = 100; + private const float TIMEOUT_FOR_MODULE_INSTALLATION = 20f; + + static ModuleInstaller() + { + Events.registeringPackages -= OnRegisteringPackages; + Events.registeringPackages += OnRegisteringPackages; + +#if !READY_PLAYER_ME + EditorApplication.delayCall += DelayCreateCoreSettings; + DefineSymbolHelper.AddSymbols(); +#endif + } + + /// + /// Called when a package is about to be added, removed or changed. + /// + /// Describes the PackageInfo entries of packages currently registering. + private static void OnRegisteringPackages(PackageRegistrationEventArgs args) + { + // Core module uninstalled + if (args.removed != null && args.removed.Any(p => p.name == ModuleList.Core.name)) + { + DefineSymbolHelper.RemoveSymbols(); + ProjectPrefs.SetBool(ProjectPrefs.FIRST_TIME_SETUP_DONE, false); + } + } + + private static void DelayCreateCoreSettings() + { + EditorApplication.delayCall -= DelayCreateCoreSettings; + CoreSettingsLoader.EnsureSettingsExist(); + + } + + + /// + /// Request UPM to install the given module with the identifier. + /// + /// The Unity package identifier of the module to be installed. + public static void AddModuleRequest(string identifier) + { + var startTime = Time.realtimeSinceStartup; + AddRequest addRequest = Client.Add(identifier); + while (!addRequest.IsCompleted && Time.realtimeSinceStartup - startTime < TIMEOUT_FOR_MODULE_INSTALLATION) + Thread.Sleep(THREAD_SLEEP_TIME); + + if (Time.realtimeSinceStartup - startTime >= TIMEOUT_FOR_MODULE_INSTALLATION) + { + Debug.LogError($"Package installation timed out for {identifier}. Please try again."); + } + if (addRequest.Error != null) + { + Debug.LogError("Error: " + addRequest.Error.message); + } + } + + /// + /// Check if the given module with the name is currently installed. + /// + /// Name of the module. + /// A boolean true if the module is installed. + public static bool IsModuleInstalled(string name) + { + return GetPackageList().Any(info => info.name == name); + } + + /// + /// Get the list of unity packages installed in the current project. + /// + /// An array of PackageInfo. + public static PackageInfo[] GetPackageList() + { + ListRequest listRequest = Client.List(true); + while (!listRequest.IsCompleted) + Thread.Sleep(THREAD_SLEEP_TIME); + + if (listRequest.Error != null) + { + SDKLogger.Log(TAG, "Error: " + listRequest.Error.message); + return Array.Empty(); + } + + return listRequest.Result.ToArray(); + } + + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs.meta new file mode 100644 index 00000000..6bf0e537 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5201abe9c7e36574d90cd052f0e8cda3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleInstaller.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs new file mode 100644 index 00000000..32f999bd --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEditor.PackageManager; + +namespace ReadyPlayerMe.Core.Editor +{ + /// + /// Class ModuleList is a static class that can be referenced to get the latest module version. + /// + public static class ModuleList + { + public static ModuleInfo Core = new ModuleInfo + { + name = "com.readyplayerme.core", + gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-core.git", + branch = "", + version = "5.0.0" + }; + + /// + /// A static list of all the required modules represented in an array of ModuleInfo. + /// + public static readonly ModuleInfo[] Modules = + { + new ModuleInfo + { + name = "com.readyplayerme.webview", + gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-webview.git", + branch = "", + version = "2.1.3" + } + }; + + /// + /// Unity Module that adds support for gltf files that use DracoCompression. + /// + public static ModuleInfo DracoCompression = new ModuleInfo + { + name = "com.atteneder.draco", + gitUrl = "https://github.com/atteneder/DracoUnity.git", + branch = "", + version = "4.1.0" + }; + + /// + /// Get installed modules from Modules list. + /// + /// A of installed Unity Module information in the format of Dictionary<string: name, string: version>. + public static Dictionary GetInstalledModuleVersionDictionary() + { + PackageInfo[] packageList = ModuleInstaller.GetPackageList(); + + var installedModules = new Dictionary(); + installedModules.Add(Core.name, Core.version); + + foreach (ModuleInfo module in Modules) + { + if (packageList.Any(x => x.name == module.name)) + { + installedModules.Add(module.name, module.version); + } + } + + if (packageList.Any(x => x.name == DracoCompression.name)) + { + installedModules.Add(DracoCompression.name, DracoCompression.version); + } + + return installedModules; + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs.meta new file mode 100644 index 00000000..cdec5655 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 725bcc26dc146374c8f0d96d3928d7ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleList.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs new file mode 100644 index 00000000..277ec207 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs @@ -0,0 +1,211 @@ +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Newtonsoft.Json; +using ReadyPlayerMe.Core.Analytics; +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; +using UnityEngine.Networking; +using PackageInfo = UnityEditor.PackageManager.PackageInfo; + +namespace ReadyPlayerMe.Core.Editor +{ + /// + /// It is responsible for checking and updating the Ready Player Me SDK modules. + /// + [InitializeOnLoad] + public class ModuleUpdater + { + + private class Release + { + [JsonProperty("tag_name")] + public string Tag; + } + + private const string PACKAGE_JSON = "package.json"; + private const string PACKAGE_DOMAIN = "com.readyplayerme"; + + private const string GITHUB_WEBSITE = "https://github.com"; + private const string GITHUB_API_URL = "https://api.github.com/repos"; + + private const int MILLISECONDS_TIMEOUT = 20; + private const string ASSET_FILTER = "package"; + + private const string DONT_ASK = "Dont Ask"; + private const string UPDATE_PACKAGES_WINDOW_TITLE = "Update Packages"; + private const string UPDATE_BUTTON_TEXT = "Update"; + private const string CANCEL_BUTTON_TEXT = "Cancel"; + private const string DONT_ASK_TEXT = "Don't ask"; + + private const string AVATAR_LOADER_PACKAGE = "com.readyplayerme.avatarloader"; + + static ModuleUpdater() + { + EntryPoint.Startup += () => Check(true); + } + + /// + /// Check for Ready Player Me package updates. + /// + [MenuItem("Tools/Ready Player Me/Check For Updates", priority = 23)] + public static void CheckForUpdates() + { + AnalyticsEditorLogger.EventLogger.LogCheckForUpdates(); + Check(); + } + + private static void Check(bool isStartup = false) + { + // Get PackageInfo array from RPM Module package.json files + PackageInfo[] packages = AssetDatabase.FindAssets(ASSET_FILTER) + .Select(AssetDatabase.GUIDToAssetPath) + .Where(x => x.Contains(PACKAGE_JSON) && x.Contains(PACKAGE_DOMAIN)) + .Select(PackageInfo.FindForAssetPath) + .ToArray(); + + if (packages.Length == 0) + { + Debug.Log("No rpm package found"); + } + + // Turn package_name@repo_url#branch_name into https://api.github.com/repos/readyplayerme/repo_name/releases + foreach (PackageInfo package in packages) + { + var repoUrl = package.packageId.Split('@')[1]; + var releasesUrl = repoUrl + .Split(new[] { ".git" }, StringSplitOptions.None)[0] + .Replace(GITHUB_WEBSITE, GITHUB_API_URL) + "/releases"; + + var packageUrl = repoUrl.Split('#')[0]; + + // Experimental or prerelease packages might look like 0.1.0-exp.1, remove after dash to parse with Version + var version = package.version.Split('-')[0]; + + if (isStartup && EditorPrefs.GetBool(DONT_ASK + "-" + package.name)) + { + continue; + } + + FetchReleases(package.name, packageUrl, releasesUrl, new Version(version)); + } + } + + /// + /// Fetch latest release for each module and prompt for update if available. + /// + /// The name of the Unity package. + /// The Git URL of the Unity package. + /// The Git URL of the Unity package. + /// The current version of the package. + private static async void FetchReleases(string packageName, string packageUrl, string releasesUrl, + Version currentVersion) + { + UnityWebRequest request = UnityWebRequest.Get(releasesUrl); + UnityWebRequestAsyncOperation op = request.SendWebRequest(); + while (!op.isDone) await Task.Yield(); + + if (request.result == UnityWebRequest.Result.Success) + { + var response = request.downloadHandler.text; + Release[] releases = JsonConvert.DeserializeObject(response); + Version[] versions = releases!.Select(r => new Version(r.Tag.Substring(1).Split('-')[0])).ToArray(); + + Version latestVersion = versions.Max(); + + if (latestVersion > currentVersion) + { + DisplayUpdateDialog(packageName, currentVersion, latestVersion, packageUrl); + } + } + else + { + Debug.Log($"Failed to fetch {packageName} releases. Error: {request.error} "); + } + } + + /// + /// Display a Unity popup with notification about available package updates with buttons to update or skip. + /// + /// The name of the Unity package. + /// The current version of the package. + /// The new version of the package. + /// The Git URL of the Unity package. + private static void DisplayUpdateDialog(string packageName, Version currentVersion, Version latestVersion, + string packageUrl) + { + var shouldUpdate = EditorUtility.DisplayDialogComplex(UPDATE_PACKAGES_WINDOW_TITLE, + $"New update available for {packageName}\nCurrent version: {currentVersion}\nLatest version: {latestVersion}", + UPDATE_BUTTON_TEXT, + CANCEL_BUTTON_TEXT, + DONT_ASK_TEXT); + + switch (shouldUpdate) + { + // Update + case 0: + CheckIfMajorRelease(packageName, currentVersion, latestVersion, packageUrl); + break; + // Cancel + case 1: + // Do nothing + break; + // Don't ask + case 2: + EditorPrefs.SetBool(DONT_ASK + "-" + packageName, true); + break; + } + } + + private static void CheckIfMajorRelease(string packageName, Version currentVersion, Version latestVersion, + string packageUrl) + { + if (latestVersion.Major > currentVersion.Major) + { + BreakingChangeDialog.ShowDialog(() => + { + UpdateModule(packageName, packageUrl, currentVersion, latestVersion); + }); + + } + else + { + UpdateModule(packageName, packageUrl, currentVersion, latestVersion); + } + } + + /// + /// Update the specified module by removing the current version and then adding the specified version. + /// + /// The name of the Unity package. + /// The Git URL of the Unity package. + /// The current version of the package. + /// The new version of the package. + private static void UpdateModule(string name, string url, Version current, Version latest) + { + url += "#v" + latest; + CleanRedundantAvatarLoader(); + RemoveRequest removeRequest = Client.Remove(name); + while (!removeRequest.IsCompleted) Thread.Sleep(MILLISECONDS_TIMEOUT); + + AddRequest addRequest = Client.Add(url); + while (!addRequest.IsCompleted) Thread.Sleep(MILLISECONDS_TIMEOUT); + + Debug.Log($"Updated {name} from v{current} to v{latest}"); + } + + private static void CleanRedundantAvatarLoader() + { + if (!ModuleInstaller.IsModuleInstalled(AVATAR_LOADER_PACKAGE)) + { + return; + } + + RemoveRequest removeRequest = Client.Remove(AVATAR_LOADER_PACKAGE); + while (!removeRequest.IsCompleted) Thread.Sleep(MILLISECONDS_TIMEOUT); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs.meta new file mode 100644 index 00000000..62ea063b --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 40c5062ebf8390443a66ccca5f9d4507 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ModuleManagement/ModuleUpdater.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager.meta new file mode 100644 index 00000000..c0793d71 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2ac2b39cc7ef4a5988d6ac77077db307 +timeCreated: 1699344120 \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs new file mode 100644 index 00000000..871e5a0d --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs @@ -0,0 +1,35 @@ +using System; +using System.Linq; +using ReadyPlayerMe.Core.Analytics; +using UnityEditor; +using UnityEditor.PackageManager; + +namespace ReadyPlayerMe.Core.Editor +{ + public abstract class PackageManagerEventListener + { + public static event Action OnPackageImported; + + [InitializeOnLoadMethod] + static void Initialize() + { + Events.registeredPackages += OnPackagesInstalled; + } + + ~PackageManagerEventListener() + { + Events.registeredPackages -= OnPackagesInstalled; + } + + static void OnPackagesInstalled(PackageRegistrationEventArgs packageRegistrationEventArgs) + { + packageRegistrationEventArgs.added + .ToList() + .ForEach(packageInfo => + { + OnPackageImported?.Invoke(packageInfo.name); + AnalyticsEditorLogger.EventLogger.LogPackageInstalled(packageInfo.name, packageInfo.packageId); + }); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs.meta new file mode 100644 index 00000000..99232da0 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a08c3f9ac3c142dc9ea5d854a1bc3af1 +timeCreated: 1699344135 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerEventListener.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs new file mode 100644 index 00000000..aff3bc8b --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs @@ -0,0 +1,68 @@ +using System; +using System.Linq; +using System.Threading; +using UnityEditor.PackageManager; +using UnityEngine; + +namespace ReadyPlayerMe.Core.Editor +{ + public abstract class PackageManagerHelper + { + private const string TAG = nameof(PackageManagerHelper); + private const int THREAD_SLEEP_TIME = 100; + private const float TIMEOUT_FOR_PACKAGE_INSTALLATION = 20f; + private const string READY_PLAYER_ME_PACKAGE_PATH = "Packages/com.readyplayerme.core"; + + public static bool IsPackageInstalled(string name) + { + return GetPackageList().Any(info => info.name == name); + } + + /// + /// Get the list of unity packages installed in the current project. + /// + /// An array of PackageInfo. + public static PackageInfo[] GetPackageList() + { + var listRequest = Client.List(true); + while (!listRequest.IsCompleted) + Thread.Sleep(THREAD_SLEEP_TIME); + + if (listRequest.Error == null) + { + return listRequest.Result.ToArray(); + } + + SDKLogger.Log(TAG, "Error: " + listRequest.Error.message); + return Array.Empty(); + + } + + public static string GetSdkPackageSourceUrl() + { + var sdkPackageInfo = PackageInfo.FindForAssetPath(READY_PLAYER_ME_PACKAGE_PATH); + + return sdkPackageInfo?.packageId + .Split(new[] { '@' }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault(); + } + + public static void AddPackage(string identifier) + { + var startTime = Time.realtimeSinceStartup; + var addRequest = Client.Add(identifier); + + while (!addRequest.IsCompleted && Time.realtimeSinceStartup - startTime < TIMEOUT_FOR_PACKAGE_INSTALLATION) + Thread.Sleep(THREAD_SLEEP_TIME); + + if (Time.realtimeSinceStartup - startTime >= TIMEOUT_FOR_PACKAGE_INSTALLATION) + { + Debug.LogError($"Package installation timed out for {identifier}. Please try again."); + } + if (addRequest.Error != null) + { + Debug.LogError("Error: " + addRequest.Error.message); + } + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs.meta new file mode 100644 index 00000000..9986fed5 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1c12b21e35214e19a1c3dfe7148a3fda +timeCreated: 1698851420 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/PackageManager/PackageManagerHelper.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors.meta new file mode 100644 index 00000000..3ed49b0f --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc95a31f3c977d74d95cba569605dbf1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs new file mode 100644 index 00000000..ed5d3e6e --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs @@ -0,0 +1,19 @@ +using ReadyPlayerMe.Core.Analytics; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +namespace ReadyPlayerMe.Core.Editor +{ + public static class BuildPostProcessor + { + [PostProcessBuild(1)] + public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) + { + // create asset if it has been deleted + CoreSettingsLoader.EnsureSettingsExist(); + AppData appData = ApplicationData.GetData(); + AnalyticsEditorLogger.EventLogger.LogBuildApplication(appData.BuildTarget, PlayerSettings.productName, !Debug.isDebugBuild); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs.meta new file mode 100644 index 00000000..c0483022 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9efa9adc0c4948579b226dac039a2e85 +timeCreated: 1657013212 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPostProcessor.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs new file mode 100644 index 00000000..d4d06a6b --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs @@ -0,0 +1,40 @@ +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.Build.Reporting; +using UnityEngine; + +namespace ReadyPlayerMe.Core.Editor +{ + public class BuildPreprocessor : IPreprocessBuildWithReport + { + private const string TAG = nameof(BuildPreprocessor); + private const string ADD_SHADER_VARIANTS = "Add and Build"; + private const string BUILD_WARNING = "Build Warning"; + private const string SUBDOMAIN_WARNING = + @"It looks like the glTFast Shader Variants are missing from the Graphics Settings/Preloaded Shader list list. This can cause errors when loading Ready Player Me avatars at runtime. Would you like to add them now before building?"; + private const string CONTINUE_WITH_DEMO = "Build without Variants"; + private const string WARNING_BUILD_WITHOUT_VARIANTS = "Building without adding glTFast Shader Variants"; + + public int callbackOrder { get; } + + public void OnPreprocessBuild(BuildReport report) + { + if (!Application.isBatchMode && GraphicsSettingsUtility.IsMissingVariants()) + { + var addShaderVariants = EditorUtility.DisplayDialog(BUILD_WARNING, + SUBDOMAIN_WARNING, + ADD_SHADER_VARIANTS, + CONTINUE_WITH_DEMO); + + if (addShaderVariants) + { + GraphicsSettingsUtility.AddPreloadShaderVariants(); + } + else + { + SDKLogger.LogWarning(TAG, WARNING_BUILD_WITHOUT_VARIANTS); + } + } + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs.meta new file mode 100644 index 00000000..b61d9e94 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0d1731ba78624114ba8112a23e3033a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/BuildPreprocessor.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs new file mode 100644 index 00000000..1fd4c6dd --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs @@ -0,0 +1,30 @@ +using UnityEditor; + +namespace ReadyPlayerMe.Core.Editor +{ + public class ModelAssetProcessor : AssetPostprocessor + { + private const string ANIMATION_ASSET_PATH = "Assets/Ready Player Me/Animations"; + + private void OnPreprocessModel() + { + var modelImporter = assetImporter as ModelImporter; + UpdateAnimationFileSettings(modelImporter); + } + + private void UpdateAnimationFileSettings(ModelImporter modelImporter) + { + void SetModelImportData() + { + if (modelImporter is null) return; + modelImporter.useFileScale = false; + modelImporter.animationType = ModelImporterAnimationType.Human; + } + + if (assetPath.Contains(ANIMATION_ASSET_PATH)) + { + SetModelImportData(); + } + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs.meta new file mode 100644 index 00000000..b4fd2375 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 42dc49b3ab05c424a80c14e9bfae17e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Processors/ModelAssetProcessor.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef new file mode 100644 index 00000000..5cc3d39a --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef @@ -0,0 +1,19 @@ +{ + "name": "ReadyPlayerMe.Core.Editor", + "rootNamespace": "", + "references": [ + "ReadyPlayerMe.Core", + "ReadyPlayerMe.AvatarCreator" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef.meta new file mode 100644 index 00000000..09421590 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 36f486ff968bbf4439cd840e8fca87ea +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/ReadyPlayerMe.Core.Editor.asmdef + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings.meta new file mode 100644 index 00000000..358776c9 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52273617608987047a79eb2417aab281 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs new file mode 100644 index 00000000..c8fb7a9c --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs @@ -0,0 +1,44 @@ +using UnityEditor; +using UnityEngine; + +namespace ReadyPlayerMe.Core.Editor +{ + [InitializeOnLoad] + public class AvatarLoaderSettingsCreator + { + private const string SETTINGS_SAVE_FOLDER = "Ready Player Me/Resources/Settings"; + private const string AVATAR_LOADER_ASSET_NAME = "AvatarLoaderSettings.asset"; + + static AvatarLoaderSettingsCreator() + { + EditorApplication.delayCall += CreateSettingsAssets; + } + + ~AvatarLoaderSettingsCreator() + { + EditorApplication.delayCall -= CreateSettingsAssets; + } + + private static void CreateSettingsAssets() + { + if (AvatarLoaderSettings.LoadSettings() != null) + { + return; + } + DirectoryUtility.ValidateDirectory($"{Application.dataPath}/{SETTINGS_SAVE_FOLDER}"); + AssetDatabase.Refresh(); + CreateAvatarLoaderSettings(); + } + + private static void CreateAvatarLoaderSettings() + { + var newSettings = ScriptableObject.CreateInstance(); + newSettings.AvatarConfig = null; + newSettings.GLTFDeferAgent = null; + newSettings.AvatarCachingEnabled = true; + + AssetDatabase.CreateAsset(newSettings, $"Assets/{SETTINGS_SAVE_FOLDER}/{AVATAR_LOADER_ASSET_NAME}"); + AssetDatabase.SaveAssets(); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs.meta new file mode 100644 index 00000000..98b17b4c --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1ea257c9bde84481a358e3685eef8646 +timeCreated: 1670940169 +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/AvatarLoaderSettingsCreator.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs new file mode 100644 index 00000000..87051658 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs @@ -0,0 +1,36 @@ +using System.IO; +using ReadyPlayerMe.Core.Data; +using UnityEditor; +using UnityEngine; + +namespace ReadyPlayerMe.Core.Editor +{ + [InitializeOnLoad] + public static class CoreSettingsLoader + { + private const string PROJECT_RELATIVE_ASSET_PATH = "Assets/Ready Player Me/Resources/Settings/CoreSettings.asset"; + private const string SETTINGS_SAVE_FOLDER = "Ready Player Me/Resources/Settings"; + + static CoreSettingsLoader() + { + EnsureSettingsExist(); + } + + public static void EnsureSettingsExist() + { + if (CoreSettingsHandler.CoreSettings == null && !File.Exists($"{Application.dataPath}/Ready Player Me/Resources/Settings/CoreSettings.asset")) + { + CreateSettings(); + } + } + + private static void CreateSettings() + { + DirectoryUtility.ValidateDirectory($"{Application.dataPath}/{SETTINGS_SAVE_FOLDER}"); + var newSettings = ScriptableObject.CreateInstance(); + AssetDatabase.CreateAsset(newSettings, PROJECT_RELATIVE_ASSET_PATH); + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs.meta new file mode 100644 index 00000000..2f0acb31 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: da717eefac74935459a3f995092c5463 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsLoader.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs new file mode 100644 index 00000000..5b5207be --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs @@ -0,0 +1,44 @@ +using UnityEditor; + +namespace ReadyPlayerMe.Core.Editor +{ + public static class CoreSettingsSetter + { + public static void SetEnableAnalytics(bool isEnabled) + { + CoreSettingsHandler.CoreSettings.EnableAnalytics = isEnabled; + Save(); + } + + public static void SetEnableLogging(bool isEnabled) + { + CoreSettingsHandler.CoreSettings.EnableLogging = isEnabled; + Save(); + } + + public static void SaveSubDomain(string subDomain) + { + if (string.IsNullOrEmpty(subDomain) || CoreSettingsHandler.CoreSettings.Subdomain == subDomain) return; + CoreSettingsHandler.CoreSettings.Subdomain = subDomain; + Save(); + } + + public static void SaveAppId(string appId) + { + CoreSettingsHandler.CoreSettings.AppId = appId; + Save(); + } + + public static void SaveBodyType(BodyType bodyType) + { + CoreSettingsHandler.CoreSettings.BodyType = bodyType; + Save(); + } + + public static void Save() + { + EditorUtility.SetDirty(CoreSettingsHandler.CoreSettings); + AssetDatabase.SaveAssets(); + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs.meta new file mode 100644 index 00000000..5115c294 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 79be5f9e434a00b46bacd5a47871b69a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/CoreSettingsSetter.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs new file mode 100644 index 00000000..1c9ef019 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs @@ -0,0 +1,138 @@ +using System.IO; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; + +namespace ReadyPlayerMe.Core.Editor +{ + public enum RenderPipeline { Standard, URP, HDRP } + public static class GraphicsSettingsUtility + { + private const string TAG = nameof(GraphicsSettingsUtility); + private const string PRELOADED_SHADER_PROPERTY = "m_PreloadedShaders"; + private const string GRAPHICS_SETTING_PATH = "ProjectSettings/GraphicsSettings.asset"; + + private const string SHADER_VARIANT_ASSETS_FOLDER = "Assets/Ready Player Me/Core/Runtime/Core/Shaders"; + private const string SHADER_VARIANT_PACKAGES_FOLDER = "Packages/com.readyplayerme.core/Runtime/Core/Shaders"; + + private const string SHADER_VARIANTS_STANDARD = "glTFastShaderVariants"; + private const string SHADER_VARIANTS_URP = "glTFastShaderVariantsURP"; + private const string SHADER_VARIANTS_HDRP = "glTFastShaderVariantsHDRP"; + + private const string HDRP_TYPE_NAME = "HDRenderPipelineAsset"; + private const string URP_TYPE_NAME = "UniversalRenderPipelineAsset"; + private const string SHADER_SESSION_CHECK = "SHADER_SESSION_CHECK"; + private const string VARIANTS_FOUND_LOG = "glTFast shader variants found in Graphics Settings->Preloaded Shaders"; + private const string SHADER_VARIANTS_EXTENSION = ".shadervariants"; + + [InitializeOnLoadMethod] + private static void InitializeOnLoad() + { + if (SessionState.GetBool(SHADER_SESSION_CHECK, false)) return; + SessionState.SetBool(SHADER_SESSION_CHECK, true); + + EditorApplication.update += CheckAndUpdatePreloadShaders; + } + + private static void CheckAndUpdatePreloadShaders() + { + EditorApplication.update -= CheckAndUpdatePreloadShaders; + AddPreloadShaderVariants(true); + } + + public static void AddPreloadShaderVariants(bool checkForMissingVariants = false) + { + var graphicsSettings = AssetDatabase.LoadAssetAtPath(GRAPHICS_SETTING_PATH); + var serializedGraphicsObject = new SerializedObject(graphicsSettings); + SerializedProperty shaderPreloadArray = serializedGraphicsObject.FindProperty(PRELOADED_SHADER_PROPERTY); + AssetDatabase.Refresh(); + + var newArrayIndex = shaderPreloadArray.arraySize; + var shaderVariants = AssetDatabase.LoadAssetAtPath(GetTargetShaderPath()); + if (shaderVariants == null) + { + Debug.LogWarning($"Shader variants not found at {GetTargetShaderPath()}"); + return; + } + if (checkForMissingVariants) + { + var shadersMissing = true; + var serializedVariants = new SerializedObject(shaderVariants); + + foreach (SerializedProperty shaderInclude in shaderPreloadArray) + { + if (shaderInclude.objectReferenceValue.name == serializedVariants.targetObject.name) + { + SDKLogger.Log(TAG, VARIANTS_FOUND_LOG); + shadersMissing = false; + break; + } + } + if (!shadersMissing) return; + } + + shaderPreloadArray.InsertArrayElementAtIndex(newArrayIndex); + SerializedProperty shaderInArray = shaderPreloadArray.GetArrayElementAtIndex(newArrayIndex); + shaderInArray.objectReferenceValue = shaderVariants; + + serializedGraphicsObject.ApplyModifiedProperties(); + AssetDatabase.SaveAssets(); + } + + public static bool IsMissingVariants() + { + var graphicsSettings = AssetDatabase.LoadAssetAtPath(GRAPHICS_SETTING_PATH); + var serializedGraphicsObject = new SerializedObject(graphicsSettings); + + SerializedProperty shaderPreloadArray = serializedGraphicsObject.FindProperty(PRELOADED_SHADER_PROPERTY); + + var shaderVariants = AssetDatabase.LoadAssetAtPath(GetTargetShaderPath()); + var shadersMissing = true; + var serializedVariants = new SerializedObject(shaderVariants); + + foreach (SerializedProperty shaderInclude in shaderPreloadArray) + { + if (shaderInclude.objectReferenceValue.name == serializedVariants.targetObject.name) + { + SDKLogger.Log(TAG, VARIANTS_FOUND_LOG); + + shadersMissing = false; + break; + } + } + return shadersMissing; + } + + private static string GetTargetShaderPath() + { + var shaderFolderPath = SHADER_VARIANT_PACKAGES_FOLDER; + if (!Directory.Exists(shaderFolderPath)) + { + shaderFolderPath = SHADER_VARIANT_ASSETS_FOLDER; + } + return GetCurrentRenderPipeline() switch + { + RenderPipeline.URP => $"{shaderFolderPath}/{SHADER_VARIANTS_URP}{SHADER_VARIANTS_EXTENSION}", + RenderPipeline.HDRP => $"{shaderFolderPath}/{SHADER_VARIANTS_HDRP}{SHADER_VARIANTS_EXTENSION}", + _ => $"{shaderFolderPath}/{SHADER_VARIANTS_STANDARD}{SHADER_VARIANTS_EXTENSION}" + }; + } + + private static RenderPipeline GetCurrentRenderPipeline() + { + if (GraphicsSettings.defaultRenderPipeline != null) + { + var renderPipelineType = GraphicsSettings.defaultRenderPipeline.GetType().ToString(); + if (renderPipelineType.Contains(HDRP_TYPE_NAME)) + { + return RenderPipeline.HDRP; + } + if (renderPipelineType.Contains(URP_TYPE_NAME)) + { + return RenderPipeline.URP; + } + } + return RenderPipeline.Standard; + } + } +} diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs.meta new file mode 100644 index 00000000..24e56d35 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 6d2fbb1ef6a68bc4b9c0c99be430c64d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 259814 + packageName: Ready Player Me Avatar and Character Creator + packageVersion: 7.3.1 + assetPath: Assets/Ready Player Me/Core/Editor/Core/Scripts/Settings/GraphicsSettingsUtility.cs + uploadId: 704624 diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI.meta new file mode 100644 index 00000000..f4cc904e --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 18404e155f36da7408078998b6470ce2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors.meta b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors.meta new file mode 100644 index 00000000..af9a6723 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 669755add08ba044d9ffb4e764476d9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors/AvatarConfigEditor.cs b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors/AvatarConfigEditor.cs new file mode 100644 index 00000000..d5661a87 --- /dev/null +++ b/Assets/Ready Player Me/Core/Editor/Core/Scripts/UI/CustomEditors/AvatarConfigEditor.cs @@ -0,0 +1,430 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; + +namespace ReadyPlayerMe.Core.Editor +{ + [CustomEditor(typeof(AvatarConfig))] + public class AvatarConfigEditor : UnityEditor.Editor + { + private const string DIALOG_TITLE = "Read Player Me"; + private const string DIALOG_MESSAGE = "Do you want to install {0} Unity Package: {1} ?"; + private const string DIALOG_OK = "Ok"; + private const string DIALOG_CANCEL = "Cancel"; + private const string ADD_MORPH_TARGET = "Add Morph Target"; + private const string DELETE_MORPH_TARGET = "Delete Morph Target"; + private const string REMOVE_BUTTON_TEXT = "Remove"; + private const string MESH_OPT_PACKAGE_NAME = "com.unity.meshopt.decompress"; + + [SerializeField] private VisualTreeAsset visualTreeAsset; + + private AvatarConfig avatarConfigTarget; + private List