diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj index eecf0e41..d6936b39 100644 --- a/Assembly-CSharp-Editor.csproj +++ b/Assembly-CSharp-Editor.csproj @@ -1565,6 +1565,7 @@ + @@ -1574,6 +1575,7 @@ + diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index cc29dba3..dac0d6a2 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -146,6 +146,7 @@ + @@ -181,6 +182,7 @@ + @@ -1937,6 +1939,7 @@ + @@ -1946,6 +1949,7 @@ + diff --git a/Assets/3Skyboxes/33pol_00000 1.png.meta b/Assets/3Skyboxes/33pol_00000 1.png.meta index 885a182f..ae9da9d6 100644 --- a/Assets/3Skyboxes/33pol_00000 1.png.meta +++ b/Assets/3Skyboxes/33pol_00000 1.png.meta @@ -34,7 +34,7 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 0 + filterMode: 1 aniso: 1 mipBias: 0 wrapU: 0 @@ -55,7 +55,7 @@ TextureImporter: alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 - textureShape: 1 + textureShape: 2 singleChannelComponent: 0 flipbookRows: 1 flipbookColumns: 1 @@ -70,9 +70,9 @@ TextureImporter: - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 8192 - resizeAlgorithm: 0 + resizeAlgorithm: 1 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/Assets/3Skyboxes/New Lighting Settings.lighting b/Assets/3Skyboxes/New Lighting Settings.lighting new file mode 100644 index 00000000..13eede99 --- /dev/null +++ b/Assets/3Skyboxes/New Lighting Settings.lighting @@ -0,0 +1,63 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New Lighting Settings + serializedVersion: 9 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 2048 + m_LightmapSizeFixed: 0 + m_UseMipmapLimits: 1 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 1 + m_AOMaxDistance: 0.1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_EnableWorkerProcessBaking: 1 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentImportanceSampling: 1 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_RespectSceneVisibilityWhenBakingGI: 0 diff --git a/Assets/3Skyboxes/New Lighting Settings.lighting.meta b/Assets/3Skyboxes/New Lighting Settings.lighting.meta new file mode 100644 index 00000000..d211dd62 --- /dev/null +++ b/Assets/3Skyboxes/New Lighting Settings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50a55ab1a6f16c346b97d3f1db92f513 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/3Skyboxes/New Material.mat b/Assets/3Skyboxes/New Material.mat new file mode 100644 index 00000000..3249587c --- /dev/null +++ b/Assets/3Skyboxes/New Material.mat @@ -0,0 +1,142 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3982346471357629615 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New Material + m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Tex: + m_Texture: {fileID: 8900000, guid: 548d20378fd665e4aa0056817dccf79d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 + - _Exposure: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Rotation: 0 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/3Skyboxes/New Material.mat.meta b/Assets/3Skyboxes/New Material.mat.meta new file mode 100644 index 00000000..97ce5e0a --- /dev/null +++ b/Assets/3Skyboxes/New Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d89f0d8b91d053f4fbc6305a7da8abde +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AssetBundles.meta b/Assets/AssetBundles.meta new file mode 100644 index 00000000..4a69dbc6 --- /dev/null +++ b/Assets/AssetBundles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87db1c84e21d0064b92f0b9784c752b5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AssetBundles/Android.meta b/Assets/AssetBundles/Android.meta new file mode 100644 index 00000000..0df7fef9 --- /dev/null +++ b/Assets/AssetBundles/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4d2c4a6a0247154b9ba9a845cbc5957 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BNG Framework/Fonts/Montserrat-Light.ttf.meta b/Assets/BNG Framework/Fonts/Montserrat-Light.ttf.meta index 235e6995..3ff7a925 100644 --- a/Assets/BNG Framework/Fonts/Montserrat-Light.ttf.meta +++ b/Assets/BNG Framework/Fonts/Montserrat-Light.ttf.meta @@ -4,11 +4,10 @@ TrueTypeFontImporter: externalObjects: {} serializedVersion: 4 fontSize: 16 - forceTextureCase: -2 + forceTextureCase: -1 characterSpacing: 0 characterPadding: 1 includeFontData: 1 - fontName: Montserrat fontNames: - Montserrat fallbackFontReferences: diff --git a/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs b/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs index b7a2ea7b..2e241633 100644 --- a/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs +++ b/Assets/BNG Framework/Scripts/Core/PlayerTeleport.cs @@ -219,6 +219,9 @@ namespace BNG { enabled = false; } } + else{ + return; + } // Are we pressing button to check for teleport? aimingTeleport = KeyDownForTeleport(); diff --git a/Assets/Bonofun/vazir-font-v16.1.0/Vazir SDF.asset b/Assets/Bonofun/vazir-font-v16.1.0/Vazir SDF.asset index 56cfed76..6a96c955 100644 --- a/Assets/Bonofun/vazir-font-v16.1.0/Vazir SDF.asset +++ b/Assets/Bonofun/vazir-font-v16.1.0/Vazir SDF.asset @@ -12,21 +12,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} m_Name: Vazir SDF m_EditorClassIdentifier: - hashCode: -1448666521 - material: {fileID: 9007623695884566715} - materialHashCode: 714370151 m_Version: 1.1.0 - m_SourceFontFileGUID: be27cb0ebbaeb544593165882587d50b - m_SourceFontFile_EditorRef: {fileID: 12800000, guid: be27cb0ebbaeb544593165882587d50b, - type: 3} - m_SourceFontFile: {fileID: 0} - m_AtlasPopulationMode: 0 m_FaceInfo: m_FaceIndex: 0 m_FamilyName: Vazir m_StyleName: Regular m_PointSize: 35 m_Scale: 1 + m_UnitsPerEM: 0 m_LineHeight: 54.6875 m_AscentLine: 36.743164 m_CapLine: 25 @@ -42,6 +35,31 @@ MonoBehaviour: m_StrikethroughOffset: 7.6 m_StrikethroughThickness: 1.7089844 m_TabWidth: 10 + m_Material: {fileID: 9007623695884566715} + m_SourceFontFileGUID: be27cb0ebbaeb544593165882587d50b + m_CreationSettings: + sourceFontFileName: + sourceFontFileGUID: be27cb0ebbaeb544593165882587d50b + faceIndex: 0 + pointSizeSamplingMode: 0 + pointSize: 35 + padding: 5 + paddingMode: 0 + packingMode: 4 + atlasWidth: 512 + atlasHeight: 512 + characterSetSelectionMode: 6 + characterSequence: 060C,061B,061F,0621,0622,0623,0624,0625,0626,0627,0628,0629,062A,062B,062C,062D,062E,062F,0630,0631,0632,0633,0634,0635,0636,0637,0638,0639,063A,0640,0641,0642,0643,0644,0645,0646,0647,0648,0649,064A,067E,0686,0698,06A9,06AF,FEE1,FED1,06CC,FB56,FB57,FB58,FB59,FB7A,FB7B,FB7C,FB7D,FB8A,FB8B,FB8C,FB8D,FB92,FB93,FB94,FB95,FB8E,FB8F,FB90,FB91,FBFC-FBFF,FE70-FEFF,064b-065f,0670,FC5E-FC63,0660-0669,06F0-06F9 + referencedFontAssetGUID: + referencedTextAssetGUID: + fontStyle: 0 + fontStyleModifier: 0 + renderMode: 4134 + includeFontFeatures: 1 + m_SourceFontFile: {fileID: 0} + m_SourceFontFilePath: + m_AtlasPopulationMode: 0 + InternalDynamicOS: 0 m_GlyphTable: - m_Index: 152 m_Metrics: @@ -4665,7 +4683,12 @@ MonoBehaviour: - {fileID: 4102001370814347148} m_AtlasTextureIndex: 0 m_IsMultiAtlasTexturesEnabled: 0 + m_GetFontFeatures: 1 m_ClearDynamicDataOnBuild: 0 + m_AtlasWidth: 512 + m_AtlasHeight: 512 + m_AtlasPadding: 5 + m_AtlasRenderMode: 4134 m_UsedGlyphRects: - m_X: 0 m_Y: 0 @@ -6136,57 +6159,14 @@ MonoBehaviour: m_Y: 475 m_Width: 50 m_Height: 36 - m_fontInfo: - Name: - PointSize: 0 - Scale: 0 - CharacterCount: 0 - LineHeight: 0 - Baseline: 0 - Ascender: 0 - CapHeight: 0 - Descender: 0 - CenterLine: 0 - SuperscriptOffset: 0 - SubscriptOffset: 0 - SubSize: 0 - Underline: 0 - UnderlineThickness: 0 - strikethrough: 0 - strikethroughThickness: 0 - TabWidth: 0 - Padding: 0 - AtlasWidth: 0 - AtlasHeight: 0 - atlas: {fileID: 0} - m_AtlasWidth: 512 - m_AtlasHeight: 512 - m_AtlasPadding: 5 - m_AtlasRenderMode: 4134 - m_glyphInfoList: [] - m_KerningTable: - kerningPairs: [] m_FontFeatureTable: + m_MultipleSubstitutionRecords: [] + m_LigatureSubstitutionRecords: [] m_GlyphPairAdjustmentRecords: [] - fallbackFontAssets: [] + m_MarkToBaseAdjustmentRecords: [] + m_MarkToMarkAdjustmentRecords: [] + m_ShouldReimportFontFeatures: 0 m_FallbackFontAssetTable: [] - m_CreationSettings: - sourceFontFileName: - sourceFontFileGUID: be27cb0ebbaeb544593165882587d50b - pointSizeSamplingMode: 0 - pointSize: 35 - padding: 5 - packingMode: 4 - atlasWidth: 512 - atlasHeight: 512 - characterSetSelectionMode: 6 - characterSequence: 060C,061B,061F,0621,0622,0623,0624,0625,0626,0627,0628,0629,062A,062B,062C,062D,062E,062F,0630,0631,0632,0633,0634,0635,0636,0637,0638,0639,063A,0640,0641,0642,0643,0644,0645,0646,0647,0648,0649,064A,067E,0686,0698,06A9,06AF,FEE1,FED1,06CC,FB56,FB57,FB58,FB59,FB7A,FB7B,FB7C,FB7D,FB8A,FB8B,FB8C,FB8D,FB92,FB93,FB94,FB95,FB8E,FB8F,FB90,FB91,FBFC-FBFF,FE70-FEFF,064b-065f,0670,FC5E-FC63,0660-0669,06F0-06F9 - referencedFontAssetGUID: - referencedTextAssetGUID: - fontStyle: 0 - fontStyleModifier: 0 - renderMode: 4134 - includeFontFeatures: 1 m_FontWeightTable: - regularTypeface: {fileID: 0} italicTypeface: {fileID: 0} @@ -6215,6 +6195,33 @@ MonoBehaviour: boldSpacing: 7 italicStyle: 35 tabSize: 10 + m_fontInfo: + Name: + PointSize: 0 + Scale: 0 + CharacterCount: 0 + LineHeight: 0 + Baseline: 0 + Ascender: 0 + CapHeight: 0 + Descender: 0 + CenterLine: 0 + SuperscriptOffset: 0 + SubscriptOffset: 0 + SubSize: 0 + Underline: 0 + UnderlineThickness: 0 + strikethrough: 0 + strikethroughThickness: 0 + TabWidth: 0 + Padding: 0 + AtlasWidth: 0 + AtlasHeight: 0 + m_glyphInfoList: [] + m_KerningTable: + kerningPairs: [] + fallbackFontAssets: [] + atlas: {fileID: 0} --- !u!28 &4102001370814347148 Texture2D: m_ObjectHideFlags: 0 @@ -6225,10 +6232,8 @@ Texture2D: m_ImageContentsHash: serializedVersion: 2 Hash: 00000000000000000000000000000000 - m_ForcedFallbackFormat: 4 - m_DownscaleFallback: 0 m_IsAlphaChannelOptional: 0 - serializedVersion: 2 + serializedVersion: 3 m_Width: 512 m_Height: 512 m_CompleteImageSize: 262144 @@ -6237,7 +6242,8 @@ Texture2D: m_MipCount: 1 m_IsReadable: 0 m_IsPreProcessed: 0 - m_IgnoreMasterTextureLimit: 0 + m_IgnoreMipmapLimit: 0 + m_MipmapLimitGroupName: m_StreamingMipmaps: 0 m_StreamingMipmapsPriority: 0 m_VTOnly: 0 @@ -6370,3 +6376,4 @@ Material: - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Bonofun/vazir-font-v16.1.0/Vazir-Bold.ttf.meta b/Assets/Bonofun/vazir-font-v16.1.0/Vazir-Bold.ttf.meta index 3e19fdbd..24fe6b03 100644 --- a/Assets/Bonofun/vazir-font-v16.1.0/Vazir-Bold.ttf.meta +++ b/Assets/Bonofun/vazir-font-v16.1.0/Vazir-Bold.ttf.meta @@ -3,8 +3,8 @@ guid: 575337e635cd9ba449c8606ebec1f846 TrueTypeFontImporter: externalObjects: {} serializedVersion: 4 - fontSize: 16 - forceTextureCase: -2 + fontSize: 200 + forceTextureCase: -1 characterSpacing: 0 characterPadding: 1 includeFontData: 1 @@ -13,6 +13,8 @@ TrueTypeFontImporter: fallbackFontReferences: - {fileID: 12800000, guid: 60c217f3db68db4449cc6f2188365185, type: 3} - {fileID: 12800000, guid: e2ee5a696599a644697bcfc244e6747e, type: 3} + - {fileID: 12800000, guid: be27cb0ebbaeb544593165882587d50b, type: 3} + - {fileID: 12800000, guid: 38dde9f5e50a2c541a5d747fa989c9f6, type: 3} customCharacters: fontRenderingMode: 0 ascentCalculationMode: 1 diff --git a/Assets/Bonofun/vazir-font-v16.1.0/Vazir.ttf.meta b/Assets/Bonofun/vazir-font-v16.1.0/Vazir.ttf.meta index 11aae079..e40a8b99 100644 --- a/Assets/Bonofun/vazir-font-v16.1.0/Vazir.ttf.meta +++ b/Assets/Bonofun/vazir-font-v16.1.0/Vazir.ttf.meta @@ -3,8 +3,8 @@ guid: be27cb0ebbaeb544593165882587d50b TrueTypeFontImporter: externalObjects: {} serializedVersion: 4 - fontSize: 16 - forceTextureCase: -2 + fontSize: 198 + forceTextureCase: -1 characterSpacing: 0 characterPadding: 1 includeFontData: 1 diff --git a/Assets/CameraLayer.renderTexture b/Assets/CameraLayer.renderTexture new file mode 100644 index 00000000..bac4949b --- /dev/null +++ b/Assets/CameraLayer.renderTexture @@ -0,0 +1,39 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!84 &8400000 +RenderTexture: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CameraLayer + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_IsAlphaChannelOptional: 0 + serializedVersion: 6 + m_Width: 1920 + m_Height: 1080 + m_AntiAliasing: 4 + m_MipCount: -1 + m_DepthStencilFormat: 0 + m_ColorFormat: 8 + m_MipMap: 0 + m_GenerateMips: 1 + m_SRGB: 0 + m_UseDynamicScale: 0 + m_UseDynamicScaleExplicit: 0 + m_BindMS: 0 + m_EnableCompatibleFormat: 1 + m_EnableRandomWrite: 0 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 0 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_Dimension: 2 + m_VolumeDepth: 1 + m_ShadowSamplingMode: 2 diff --git a/Assets/CameraLayer.renderTexture.meta b/Assets/CameraLayer.renderTexture.meta new file mode 100644 index 00000000..12f14951 --- /dev/null +++ b/Assets/CameraLayer.renderTexture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 94acf02510cfb02449715e586b712709 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 8400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/CoachingRoom.unity b/Assets/CoachingRoom.unity new file mode 100644 index 00000000..e3b98261 --- /dev/null +++ b/Assets/CoachingRoom.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:769117b7c8a27787198ab2158fa43bfa3091a81b0a919990c48b5636e59e8818 +size 3919238 diff --git a/Assets/CoachingRoom.unity.meta b/Assets/CoachingRoom.unity.meta new file mode 100644 index 00000000..84d55d64 --- /dev/null +++ b/Assets/CoachingRoom.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 83dc4faec09f89a4ca317b09af0f14c2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: futuristicroom10 + assetBundleVariant: 12 diff --git a/Assets/Coworking office/Models/Materials/Glass panel.mat b/Assets/Coworking office/Models/Materials/Glass panel.mat index be716783..b72329ec 100644 --- a/Assets/Coworking office/Models/Materials/Glass panel.mat +++ b/Assets/Coworking office/Models/Materials/Glass panel.mat @@ -25,6 +25,8 @@ Material: m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 m_ValidKeywords: + - _ALPHAPREMULTIPLY_ON + - _SPECULAR_SETUP - _SURFACE_TYPE_TRANSPARENT m_InvalidKeywords: [] m_LightmapFlags: 4 @@ -102,7 +104,7 @@ Material: - _AddPrecomputedVelocity: 0 - _AlphaClip: 0 - _AlphaToMask: 0 - - _Blend: 1 + - _Blend: 0 - _BlendModePreserveSpecular: 1 - _BumpScale: 1 - _ClearCoatMask: 0 @@ -130,7 +132,7 @@ Material: - _SrcBlendAlpha: 1 - _Surface: 1 - _UVSec: 0 - - _WorkflowMode: 1 + - _WorkflowMode: 0 - _ZWrite: 0 m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 0} diff --git a/Assets/Dark UI/Free/128.png.meta b/Assets/Dark UI/Free/128.png.meta index 92aaf2a2..838c05e4 100644 --- a/Assets/Dark UI/Free/128.png.meta +++ b/Assets/Dark UI/Free/128.png.meta @@ -1,9 +1,16 @@ fileFormatVersion: 2 guid: 87ea2079a91b3e74f84b5cb700abb4d6 +AssetOrigin: + serializedVersion: 1 + productId: 199010 + packageName: Dark Theme UI + packageVersion: 1.1 + assetPath: Assets/Dark UI/Free/128.png + uploadId: 700413 TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 11 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,10 +27,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -32,9 +41,9 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 + filterMode: 0 + aniso: 1 + mipBias: 0 wrapU: 1 wrapV: 1 wrapW: 1 @@ -62,8 +71,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 @@ -73,12 +84,40 @@ TextureImporter: 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -88,16 +127,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: -AssetOrigin: - serializedVersion: 1 - productId: 199010 - packageName: Dark Theme UI - packageVersion: 1.1 - assetPath: Assets/Dark UI/Free/128.png - uploadId: 700413 diff --git a/Assets/EN.cs b/Assets/EN.cs index ed0fb607..cce2b122 100644 --- a/Assets/EN.cs +++ b/Assets/EN.cs @@ -1,72 +1,111 @@ using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; using UnityEngine.Android; using static ENMenu; public class EN : MonoBehaviour { - //[System.Serializable] - //public class User - //{ - // public int id; - // public string name; - // public string job; - // public GameObject character; - - //} - + public static EN instance; + public List users = new List(); public User SelectedUser; public User Me; + // ✅ Lists for meetings and spaces + public List meetings = new List(); + public List spaces = new List(); + public string selectedSpaceUrl; + public string selectedSpaceId; + + public GameObject Error; - // Start is called once before the first execution of Update after the MonoBehaviour is created void Awake() { - if(EN.instance) + if (EN.instance) { Destroy(gameObject); return; - } + } DontDestroyOnLoad(this.gameObject); - instance = this; - + instance = this; } + public void Start() { + if (!Permission.HasUserAuthorizedPermission(Permission.Microphone)) { Permission.RequestUserPermission(Permission.Microphone); } - // StartCoroutine(webservice.instance. LoginRequest(OnLoginSuccess)); - + + // Optionally preload meetings and spaces if Me is available + // StartCoroutine(webservice.instance.GetUserMeetings(OnMeetingsLoaded)); + // StartCoroutine(webservice.instance.GetSpaces(OnSpacesLoaded)); } - public GameObject Error; - - public void showError(string title,string description) + + // ✅ Callback to populate meetings list + public void OnMeetingsLoaded(MeetingResponse response) + { + if (response != null && response.meetings != null) + { + meetings = response.meetings; + Debug.Log("Meetings loaded: " + meetings.Count); + } + else + { + showError("خطا", "بارگذاری جلسات با خطا مواجه شد"); + } + } + + // ✅ Callback to populate spaces list + public void OnSpacesLoaded(SpaceResponse response) + { + if (response != null && response.spaces != null) + { + spaces = response.spaces; + + + if (spaces != null && spaces.Count > 0 && spaces[0].assetBundleRoomId != null) + { + selectedSpaceUrl = spaces[0].assetBundleRoomId.url; + + } + else + { + Debug.LogWarning("No available spaces or assetBundleRoomId is null."); + selectedSpaceUrl = null; // or some fallback + } + + Debug.Log("Spaces loaded: " + spaces.Count); + } + else + { + showError("خطا", "بارگذاری فضاها با خطا مواجه شد"); + } + + + } + + public void showError(string title, string description) { CancelInvoke("hideError"); - gameObject.transform .position= GameObject.FindGameObjectWithTag("anocher").transform.position; - gameObject.transform .rotation= GameObject.FindGameObjectWithTag("anocher").transform.rotation; + gameObject.transform.position = GameObject.FindGameObjectWithTag("anocher").transform.position; + gameObject.transform.rotation = GameObject.FindGameObjectWithTag("anocher").transform.rotation; Error.SetActive(true); Error.transform.Find("error/title").GetComponentInChildren().text = title; Error.transform.Find("error/description").GetComponentInChildren().text = description; Invoke("hideError", 6); } + public void hideError() { Error.SetActive(false); } - // Update is called once per frame - void Update() - { - - } - internal void Print(string j) { print(j); diff --git a/Assets/ENMenu.cs b/Assets/ENMenu.cs index 3737387c..746560f6 100644 --- a/Assets/ENMenu.cs +++ b/Assets/ENMenu.cs @@ -7,15 +7,19 @@ using Siccity.GLTFUtility; using BNG; using Fusion.XR.Host.Rig; using Fusion; +using System.Threading; +using System.Linq; public class ENMenu : NetworkBehaviour { + SceneDownloader SceneDownloader; public GameObject itemPr; public Transform menu; public List items = new List(); public GameObject tablet; public UnityEngine.UI.Button button; + public UnityEngine.UI.Button buttonLoadSpace; public GameObject loading; public GameObject LoginMenu; public GameObject Rooms; @@ -36,9 +40,11 @@ public class ENMenu : NetworkBehaviour void Start() { + SceneDownloader=GetComponent(); Invoke("PlayWelcome", delay); - EN.instance.SelectedUser = EN.instance.users[0]; + EN.instance.SelectedUser = EN.instance.users.Count > 0 ? EN.instance.users[0] : null; + string user = PlayerPrefs.GetString("user", ""); if (!string.IsNullOrEmpty(user)) @@ -49,8 +55,8 @@ public class ENMenu : NetworkBehaviour var data = new Dictionary { - { "password", code.text.ToString() }, - { "mobile_number", phone.text.ToString() } + { "password", code.text }, + { "mobile_number", phone.text } }; StartCoroutine(webservice.instance.LoginRequest(data, OnLoginSuccess)); @@ -77,24 +83,24 @@ public class ENMenu : NetworkBehaviour public void Login() { - LoginMenu.gameObject.SetActive(false); - loading.gameObject.SetActive(true); + LoginMenu.SetActive(false); + loading.SetActive(true); var data = new Dictionary { - { "password", code.text.ToString() }, - { "mobile_number", phone.text.ToString() } + { "password", code.text }, + { "mobile_number", phone.text } }; - PlayerPrefs.SetString("mobile_number", phone.text.ToString()); - PlayerPrefs.SetString("password", code.text.ToString()); + PlayerPrefs.SetString("mobile_number", phone.text); + PlayerPrefs.SetString("password", code.text); StartCoroutine(webservice.instance.LoginRequest(data, OnLoginSuccess)); } void OnLoginSuccess(User response) { - loading.gameObject.SetActive(false); + loading.SetActive(false); if (response != null) { @@ -106,17 +112,24 @@ public class ENMenu : NetworkBehaviour GuestButton.SetActive(false); ExitButton.SetActive(true); EnterButton.SetActive(true); + Debug.Log("Login successful"); - - // Call GetInfo after successful login + + // After login success, load user info StartCoroutine(webservice.instance.GetInfoRequest(OnGetInfoSuccess)); + + // Also, load meetings and spaces + StartCoroutine(webservice.instance.GetUserMeetings(EN.instance.OnMeetingsLoaded)); + StartCoroutine(webservice.instance.GetSpaces(EN.instance.OnSpacesLoaded)); + + } else { switch (webservice.instance.lastErrorType) { case ErrorType.Authentication: - LoginMenu.gameObject.SetActive(true); + LoginMenu.SetActive(true); EN.instance.showError("خطا در ورود", webservice.instance.lastErrorResponse?.message ?? "نام کاربری یا رمز عبور اشتباه است"); break; case ErrorType.Network: @@ -136,9 +149,8 @@ public class ENMenu : NetworkBehaviour { if (response != null) { - // Update user information with GetInfo response EN.instance.Me.characterUrl = response.customer.profile_glb; - EN.instance.Me.character=playerPref; + EN.instance.Me.character = playerPref; Debug.Log("GetInfo successful - Character URL: " + response.customer.profile_glb); } else @@ -160,11 +172,9 @@ public class ENMenu : NetworkBehaviour if (clip != null) { GameObject audioObject = new GameObject("AudioSource_" + soundName); - AudioSource audioSource = audioObject.AddComponent(); audioSource.volume = volume; audioSource.spatialBlend = 0; - audioSource.clip = clip; audioSource.Play(); @@ -183,20 +193,26 @@ public class ENMenu : NetworkBehaviour public void Select(GameObject i) { - EN.instance.SelectedUser = EN.instance.users[int.Parse(i.name)]; + if (int.TryParse(i.name, out int index) && index >= 0 && index < EN.instance.users.Count) + { + EN.instance.SelectedUser = EN.instance.users[index]; + } } - public void SelectEnviroment(GameObject i) + public void SelectEnvironment(GameObject i) { - Application.LoadLevel(int.Parse(i.name) + 1); + if (int.TryParse(i.name, out int index)) + { + Application.LoadLevel(index + 1); + } } void Update() { - tablet.gameObject.SetActive(!EN.instance.Error.gameObject.activeSelf); + tablet.SetActive(!EN.instance.Error.activeSelf); button.interactable = phone.text.Length > 10 && code.text.Length > 3; + if (Application.isEditor) tablet.transform.parent = null; } - -} \ No newline at end of file +} diff --git a/Assets/Editor.meta b/Assets/Editor.meta new file mode 100644 index 00000000..df0af733 --- /dev/null +++ b/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd2afaeda1505d74d8dd3b7729983408 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor/AssetBundleCreator.cs b/Assets/Editor/AssetBundleCreator.cs new file mode 100644 index 00000000..7c3d201e --- /dev/null +++ b/Assets/Editor/AssetBundleCreator.cs @@ -0,0 +1,31 @@ +using UnityEditor; +using UnityEngine; + +public class AssetBundleCreator +{ + [MenuItem("Tools/Build AssetBundles/Android")] + public static void BuildAndroidAssetBundles() + { + string outputPath = "AssetBundles/Android"; + + if (!System.IO.Directory.Exists(outputPath)) + { + System.IO.Directory.CreateDirectory(outputPath); + } + + // Recommended: Force include shaders to prevent pink materials + BuildAssetBundleOptions options = + BuildAssetBundleOptions.StrictMode | // Ensures strict dependency checking + BuildAssetBundleOptions.ForceRebuildAssetBundle; // Ensures a clean rebuild + + // Build the AssetBundles + BuildPipeline.BuildAssetBundles( + outputPath, + options, + BuildTarget.Android + ); + + Debug.Log("✅ Android AssetBundles built at: " + outputPath); + AssetDatabase.Refresh(); // Refresh Unity's asset database + } +} \ No newline at end of file diff --git a/Assets/Editor/AssetBundleCreator.cs.meta b/Assets/Editor/AssetBundleCreator.cs.meta new file mode 100644 index 00000000..058709d8 --- /dev/null +++ b/Assets/Editor/AssetBundleCreator.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 29fd4556041338043b18d2872ca1afc9 \ No newline at end of file diff --git a/Assets/GraphicSettings/UniversalRenderPipelineGlobalSettings.asset b/Assets/GraphicSettings/UniversalRenderPipelineGlobalSettings.asset index 61416414..5ddfb762 100644 --- a/Assets/GraphicSettings/UniversalRenderPipelineGlobalSettings.asset +++ b/Assets/GraphicSettings/UniversalRenderPipelineGlobalSettings.asset @@ -69,7 +69,9 @@ MonoBehaviour: - rid: 420368092579495945 - rid: 420368092579495946 - rid: 420368092579495948 + - rid: 7351829830484885594 - rid: 420368092579495952 + - rid: 7351829830484885598 - rid: 420368092579495955 m_AssetVersion: 8 m_ObsoleteDefaultVolumeProfile: {fileID: 0} diff --git a/Assets/InternetChecker.cs b/Assets/InternetChecker.cs index e5332d43..5918ba2b 100644 --- a/Assets/InternetChecker.cs +++ b/Assets/InternetChecker.cs @@ -27,7 +27,7 @@ public class InternetChecker : MonoBehaviour { UnityWebRequest request = new UnityWebRequest("https://www.google.com"); request.method = UnityWebRequest.kHttpVerbHEAD; - print("ERROR"); + //print("ERROR"); yield return request.SendWebRequest(); #if UNITY_2020_1_OR_NEWER diff --git a/Assets/Materials/CameraLayer.mat b/Assets/Materials/CameraLayer.mat new file mode 100644 index 00000000..6dd32c24 --- /dev/null +++ b/Assets/Materials/CameraLayer.mat @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CameraLayer + m_Shader: {fileID: 10721, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 8400000, guid: 94acf02510cfb02449715e586b712709, type: 2} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: [] + m_Colors: [] + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/CameraLayer.mat.meta b/Assets/Materials/CameraLayer.mat.meta new file mode 100644 index 00000000..c551020b --- /dev/null +++ b/Assets/Materials/CameraLayer.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5dfbb1afc25d8c3429842e5bfe2bbb74 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Paroxe/PDFRenderer/Examples/Assets/PDFPlaneMaterial.mat b/Assets/Paroxe/PDFRenderer/Examples/Assets/PDFPlaneMaterial.mat index 8cdb3d29..cc640041 100644 --- a/Assets/Paroxe/PDFRenderer/Examples/Assets/PDFPlaneMaterial.mat +++ b/Assets/Paroxe/PDFRenderer/Examples/Assets/PDFPlaneMaterial.mat @@ -2,156 +2,138 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_Name: PDFPlaneMaterial - m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: - m_LightmapFlags: 5 + m_Shader: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _EMISSION + - _GLOSSINESS_FROM_BASE_ALPHA + - _SPECULAR_COLOR + m_InvalidKeywords: [] + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 - stringTagMap: {} + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: - serializedVersion: 2 + serializedVersion: 3 m_TexEnvs: - data: - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _BumpMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _DetailNormalMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _ParallaxMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _OcclusionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _EmissionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _DetailMask - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _DetailAlbedoMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _MetallicGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - data: - first: - name: _SpecGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - data: - first: - name: _SrcBlend - second: 1 - data: - first: - name: _DstBlend - second: 0 - data: - first: - name: _Cutoff - second: 0.5 - data: - first: - name: _Parallax - second: 0.02 - data: - first: - name: _ZWrite - second: 1 - data: - first: - name: _Glossiness - second: 0.5 - data: - first: - name: _BumpScale - second: 1 - data: - first: - name: _OcclusionStrength - second: 1 - data: - first: - name: _DetailNormalMapScale - second: 1 - data: - first: - name: _UVSec - second: 0 - data: - first: - name: _Mode - second: 0 - data: - first: - name: _Metallic - second: 0 - data: - first: - name: _EmissionScaleUI - second: 0 + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BumpScale: 1 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EmissionScaleUI: 0 + - _Glossiness: 0.5 + - _GlossinessSource: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Shininess: 0 + - _Smoothness: 0.5 + - _SmoothnessSource: 1 + - _SpecSource: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _UVSec: 0 + - _ZWrite: 1 m_Colors: - data: - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - data: - first: - name: _Color - second: {r: 1, g: 1, b: 1, a: 1} - data: - first: - name: _SpecColor - second: {r: 0.2, g: 0.2, b: 0.2, a: 1} - data: - first: - name: _EmissionColorUI - second: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColorUI: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &8218264903885036047 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 diff --git a/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset b/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset index a3520400..0cd48e59 100644 --- a/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset +++ b/Assets/Photon/Fusion/Resources/PhotonAppSettings.asset @@ -18,7 +18,7 @@ MonoBehaviour: AppIdVoice: 1fba3dfc-beb8-4854-8cf3-f3e90d096822 AppVersion: UseNameServer: 1 - FixedRegion: in + FixedRegion: tr Server: Port: 0 ProxyServer: diff --git a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs index 0ef362d9..9df94229 100644 --- a/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs +++ b/Assets/Photon/FusionAddons/ConnectionManager/Scripts/ConnectionManager.cs @@ -3,15 +3,17 @@ using Fusion.Sockets; using Fusion.XR.Host.Rig; using Photon.Realtime; using System; +using System.Linq; using System.Collections.Generic; using System.Security.Policy; using System.Threading.Tasks; using UnityEngine; using UnityEngine.Events; +using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using static Unity.Collections.Unicode; - +using System.Text.RegularExpressions; namespace Fusion.Addons.ConnectionManagerAddon { /** @@ -22,6 +24,7 @@ namespace Fusion.Addons.ConnectionManagerAddon **/ public class ConnectionManager : MonoBehaviour, INetworkRunnerCallbacks { + //public AssetBundleDownloaderAndLoader assetBundleDownloaderAndLoader; public GameObject[] chairs; public bool presentation; public GameObject Loading; @@ -38,24 +41,47 @@ namespace Fusion.Addons.ConnectionManagerAddon public string propertyName; public string value; } + + public void AssignMapReferences() + { + + + + + + if (usersPlace.Length == 0 || chairs.Length == 0) + Debug.LogWarning("[ConnectionManager] usersPlace or chairs not found after AssetBundle load."); + else + Debug.Log("[ConnectionManager] usersPlace and chairs assigned."); + + roomName=EN.instance.selectedSpaceId; + } + int ExtractNumber(string name) + { + var match = Regex.Match(name, @"\d+"); + return match.Success ? int.Parse(match.Value) : int.MaxValue; + } public void Update() { - if (Application.loadedLevelName.Equals("Lobby")) + if (Application.loadedLevelName.Equals("Lobby")) Destroy(gameObject); if (Input.GetKeyDown(KeyCode.I)) { 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(); } Loading.gameObject.SetActive(!runner||! runner.IsConnectedToServer); + + + } [Header("Room configuration")] public GameMode gameMode = GameMode.Shared; - public string roomName = "SampleFusion"; + [SerializeField]private string roomName = "SampleFusion"; public bool connectOnStart = true; [Tooltip("Set it to 0 to use the DefaultPlayers value, from the Global NetworkProjectConfig (simulation section)")] public int playerCount = 0; @@ -89,13 +115,16 @@ namespace Fusion.Addons.ConnectionManagerAddon private void Awake() { + //assetBundleDownloaderAndLoader=GetComponent(); + if (!EN.instance) { - //Application.LoadLevel(0); + Application.LoadLevel(0); Destroy(gameObject); return; } + AssignMapReferences(); // Check if a runner exist on the same game object if (runner == null) runner = GetComponent(); instance = this; @@ -115,7 +144,7 @@ namespace Fusion.Addons.ConnectionManagerAddon private async void Start() { - chairs = GameObject.FindGameObjectsWithTag("chair"); + //chairs = GameObject.FindGameObjectsWithTag("chair"); //Invoke("createChairs", 5); PlaySound("intro"); // Launch the connection at start diff --git a/Assets/Prefabs/1.prefab b/Assets/Prefabs/1.prefab new file mode 100644 index 00000000..de6405d7 --- /dev/null +++ b/Assets/Prefabs/1.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80167a11a1c7c3651291878bfbd18091d5babc323ce4c77fd503bb128778ab8c +size 16846 diff --git a/Assets/Prefabs/1.prefab.meta b/Assets/Prefabs/1.prefab.meta new file mode 100644 index 00000000..54d9ae71 --- /dev/null +++ b/Assets/Prefabs/1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 68b46b983ad510149bee875b9fcaf627 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb b/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb new file mode 100644 index 00000000..e018b62e --- /dev/null +++ b/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:176656db1241db3940c4a1c97e5f8c2059d3c5f8fdbfea45692e891aad280568 +size 42950512 diff --git a/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb.meta b/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb.meta new file mode 100644 index 00000000..53696fbb --- /dev/null +++ b/Assets/Prefabs/X_Room_03_04-03-18-002 - Copy.glb.meta @@ -0,0 +1,28 @@ +fileFormatVersion: 2 +guid: ec149ee6d067e1c49a85d7381baeaf96 +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/Prefabs/assetbundle prefabs.meta b/Assets/Prefabs/assetbundle prefabs.meta new file mode 100644 index 00000000..bafaf8f7 --- /dev/null +++ b/Assets/Prefabs/assetbundle prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3d9a7f6eb7f266438db417acb25cd66 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab b/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab new file mode 100644 index 00000000..03b28138 --- /dev/null +++ b/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b431eea181ab103b56320004df0613d881a9b9fa5bf7387717e0d114a166949c +size 388173 diff --git a/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab.meta b/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab.meta new file mode 100644 index 00000000..c72b53e0 --- /dev/null +++ b/Assets/Prefabs/assetbundle prefabs/futuristic _Room_04-03-06-003.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e70703469e9a9f5478232cfe73e395ce +labels: +- FusionPrefab +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Blocks.mat b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Blocks.mat index 409ff971..9f627257 100644 --- a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Blocks.mat +++ b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Blocks.mat @@ -1,5 +1,18 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4991990423166999442 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -8,7 +21,9 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Blocks - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: - _EMISSION - _NORMALMAP @@ -17,11 +32,18 @@ Material: m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d1118dda59970a2449ee890fa247c4c5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 2800000, guid: c5c221ed57a3bf6488f8eba0db28a004, type: 3} m_Scale: {x: 1, y: 1} @@ -43,7 +65,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 2800000, guid: d1118dda59970a2449ee890fa247c4c5, type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: @@ -58,12 +80,39 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0 - _GlossyReflections: 1 @@ -71,12 +120,21 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 - _UVSec: 0 + - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0.6, b: 0, a: 1} + - _BaseColor: {r: 1, g: 0.6, b: 0, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/GridFloor.mat b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/GridFloor.mat index 6abdb03a..67a96950 100644 --- a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/GridFloor.mat +++ b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/GridFloor.mat @@ -8,7 +8,9 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: GridFloor - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: - _EMISSION - _NORMALMAP @@ -17,18 +19,25 @@ Material: m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d1118dda59970a2449ee890fa247c4c5, type: 3} + m_Scale: {x: 5, y: 5} + m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 2800000, guid: c5c221ed57a3bf6488f8eba0db28a004, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} + m_Scale: {x: 0.2, y: 0.2} m_Offset: {x: 0, y: 0} - _DetailMask: m_Texture: {fileID: 0} @@ -43,8 +52,8 @@ Material: m_Scale: {x: 5, y: 5} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 2800000, guid: d1118dda59970a2449ee890fa247c4c5, type: 3} - m_Scale: {x: 5, y: 5} + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} @@ -58,12 +67,39 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0 - _GlossyReflections: 1 @@ -71,12 +107,34 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 - _UVSec: 0 + - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _Color: {r: 0.27058825, g: 0.65882355, b: 0.8784314, a: 1} + - _BaseColor: {r: 0.2705882, g: 0.65882355, b: 0.8784314, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &8876155319544260431 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 diff --git a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Ground.mat b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Ground.mat index 4e3e5bcf..093d7c35 100644 --- a/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Ground.mat +++ b/Assets/Ready Player Me/Core/Samples/QuickStart/Materials/Ground.mat @@ -1,5 +1,18 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4619473865430559386 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -8,25 +21,34 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Ground - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 20, y: 20} + m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} + m_Scale: {x: 0.05, y: 0.05} m_Offset: {x: 0, y: 0} - _DetailMask: m_Texture: {fileID: 0} @@ -42,7 +64,7 @@ Material: m_Offset: {x: 0, y: 0} - _MainTex: m_Texture: {fileID: 0} - m_Scale: {x: 20, y: 20} + m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} @@ -56,12 +78,39 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0 - _GlossyReflections: 1 @@ -69,12 +118,21 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 - _UVSec: 0 + - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _Color: {r: 0.50980395, g: 0.627451, b: 0.6901961, a: 1} + - _BaseColor: {r: 0.5098039, g: 0.62745106, b: 0.6901961, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/GrabHandle.mat b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/GrabHandle.mat index 73d8d391..e0699443 100644 --- a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/GrabHandle.mat +++ b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/GrabHandle.mat @@ -8,15 +8,21 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: GrabHandle - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: -6465566751694194690, guid: 0927d29e476ce5843b1f7d2a96943c51, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: [] m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] + stringTagMap: + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -44,10 +50,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _MainTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -56,9 +70,38 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: -1 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 0 - _BumpScale: 1 + - _CastShadows: 1 + - _Cull: 2 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 @@ -67,14 +110,55 @@ Material: - _GlossyReflections: 1 - _Metallic: 0 - _Mode: 0 + - _NormalStrength: 0.2 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _RimPower: 5 + - _Smoothness: 0.5 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 + - _Surface: 0 - _UVSec: 0 + - _WorkflowMode: 1 + - _ZTest: 4 - _ZWrite: 1 + - _ZWriteControl: 0 m_Colors: + - _BaseColor: {r: 0.44339618, g: 0.44339618, b: 0.44339618, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _NormalOffset: {r: 0, g: 0, b: 0, a: 0} + - _NormalTiling: {r: 1, g: 1, b: 0, a: 0} + - _RimColor: {r: 1, g: 1, b: 1, a: 0.5803922} m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &3572587442085198344 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &8779885048964753496 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 diff --git a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/ScaleHandle.mat b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/ScaleHandle.mat index 901e7e0c..0306a5e2 100644 --- a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/ScaleHandle.mat +++ b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Materials/ScaleHandle.mat @@ -1,5 +1,18 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4450609276103759250 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -8,20 +21,25 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: ScaleHandle - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: -6465566751694194690, guid: 0927d29e476ce5843b1f7d2a96943c51, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 m_ValidKeywords: + - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_InvalidKeywords: - _ALPHABLEND_ON - _GLOSSYREFLECTIONS_OFF - - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - _SPECULARHIGHLIGHTS_OFF - m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: -1 stringTagMap: - RenderType: Transparent - disabledShaderPasses: [] + RenderType: Opaque + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -53,10 +71,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _MainTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -69,34 +95,91 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _BUILTIN_AlphaClip: 0 + - _BUILTIN_Blend: 0 + - _BUILTIN_CullMode: 2 + - _BUILTIN_DstBlend: 0 + - _BUILTIN_QueueControl: -1 + - _BUILTIN_QueueOffset: 0 + - _BUILTIN_SrcBlend: 1 + - _BUILTIN_Surface: 0 + - _BUILTIN_ZTest: 4 + - _BUILTIN_ZWrite: 1 + - _BUILTIN_ZWriteControl: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 0 - _BumpScale: 1 + - _CastShadows: 1 - _ColorMask: 15 + - _Cull: 2 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - - _DstBlend: 10 + - _DstBlend: 0 - _GlossMapScale: 0 - _Glossiness: 0 - _GlossyReflections: 0 - _Metallic: 0 - _Mode: 2 + - _NormalStrength: 0.2 - _OcclusionStrength: 1 - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _RimPower: 5 + - _Smoothness: 0.5 - _SmoothnessTextureChannel: 1 - _SpecularHighlights: 0 - - _SrcBlend: 5 + - _SrcBlend: 1 - _Stencil: 0 - _StencilComp: 8 - _StencilOp: 0 - _StencilReadMask: 255 - _StencilWriteMask: 255 - _Strength: 0.2 + - _Surface: 0 - _UVSec: 0 - _UseUIAlphaClip: 0 - - _ZWrite: 0 + - _WorkflowMode: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _ZWriteControl: 0 m_Colors: + - _BaseColor: {r: 0.44339618, g: 0.44339618, b: 0.44339618, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 0.050980393} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _NormalOffset: {r: 0, g: 0, b: 0, a: 0} + - _NormalTiling: {r: 1, g: 1, b: 0, a: 0} + - _RimColor: {r: 1, g: 1, b: 1, a: 0.5803922} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5696284256474513518 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Sprites/Circle 64x64 Horizontal.png.meta b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Sprites/Circle 64x64 Horizontal.png.meta index bb8366ea..0ecb97ce 100644 --- a/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Sprites/Circle 64x64 Horizontal.png.meta +++ b/Assets/Samples/XR Interaction Toolkit/3.0.8/Spatial Keyboard/Sprites/Circle 64x64 Horizontal.png.meta @@ -3,7 +3,7 @@ guid: 30a9256eb7d98ad4188fe103a8e7143b TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 12 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,11 +20,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 - ignoreMasterTextureLimit: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -33,11 +34,11 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 1 + filterMode: 0 aniso: 1 mipBias: 0 - wrapU: 1 - wrapV: 1 + wrapU: 0 + wrapV: 0 wrapW: 0 nPOTScale: 0 lightmap: 0 @@ -63,9 +64,10 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 cookieLightType: 0 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 @@ -75,9 +77,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 @@ -87,9 +90,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Android maxTextureSize: 2048 resizeAlgorithm: 0 @@ -99,9 +103,10 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: Server maxTextureSize: 2048 resizeAlgorithm: 0 @@ -111,12 +116,14 @@ TextureImporter: crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: 5e97eb03825dee720800000000000000 @@ -126,10 +133,11 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] + spriteCustomMetadata: + entries: [] nameFileIdTable: {} - spritePackingTag: + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Scenes/test.unity b/Assets/Scenes/test.unity index dc5bc566..e60d39be 100644 --- a/Assets/Scenes/test.unity +++ b/Assets/Scenes/test.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2273c8d3ddbfa7f168aff28d5023b0f6c0784da6fc1b87cba3ef775d2392e75 -size 9756 +oid sha256:8aaac31537327be3297f4d73fc07733723dd06739d3e1cce9250e00fa805db53 +size 2962783 diff --git a/Assets/Scripts/AssetBundleDownloader.meta b/Assets/Scripts/AssetBundleDownloader.meta new file mode 100644 index 00000000..c855a7e3 --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0e66433570f71447b1bba45992e9ac1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader new file mode 100644 index 00000000..d9f8396a --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader @@ -0,0 +1,103 @@ +using System; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.Networking; +using Fusion; + +public class AssetBundleNetworkDownloader : NetworkBehaviour +{ + [Header("Reference")] + public GameObject map; // Where to spawn downloaded content + + [Networked, OnChangedRender(nameof(OnUrlChanged))] + private NetworkString<_512> BundleUrl { get; set; } + + [NonSerialized] public bool serverDownloaded = false; + + private string _previousUrl = null; + + public override void Spawned() + { + Debug.Log($"[AssetBundleDownloader] Spawned for {Object.InputAuthority}"); + + if (Object.HasInputAuthority) + { + string url = EN.instance.mapUrl; + if (!string.IsNullOrEmpty(url)) + { + Debug.Log($"[AssetBundleDownloader] Setting BundleUrl to {url}"); + BundleUrl = url; + } + else + { + Debug.LogWarning("[AssetBundleDownloader] Empty mapUrl in EN.instance"); + } + } + else + { + // Late joiner: use already set BundleUrl + if (!string.IsNullOrEmpty(BundleUrl.ToString())) + { + _previousUrl = BundleUrl.ToString(); + Debug.Log($"[AssetBundleDownloader] Late joiner loading bundle: {_previousUrl}"); + _ = DownloadAndInstantiate(_previousUrl); + } + } + } + + private void OnUrlChanged() + { + Debug.Log($"[AssetBundleDownloader] OnUrlChanged triggered: {BundleUrl}"); + + string newUrl = BundleUrl.ToString(); + if (!string.IsNullOrEmpty(newUrl) && newUrl != _previousUrl) + { + _previousUrl = newUrl; + _ = DownloadAndInstantiate(newUrl); + } + } + + private async Task DownloadAndInstantiate(string url) + { + serverDownloaded = false; + + using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle(url)) + { + var op = uwr.SendWebRequest(); + while (!op.isDone) + await Task.Yield(); + + if (uwr.result != UnityWebRequest.Result.Success) + { + Debug.LogError($"[AssetBundleDownloader] Download failed: {uwr.error}"); + return; + } + + AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr); + if (bundle == null) + { + Debug.LogError("[AssetBundleDownloader] Failed to load AssetBundle content"); + return; + } + + string[] assetNames = bundle.GetAllAssetNames(); + if (assetNames.Length > 0) + { + GameObject prefab = bundle.LoadAsset(assetNames[0]); + if (prefab != null) + { + GameObject obj = Instantiate(prefab, map ? map.transform.position : Vector3.zero, Quaternion.identity); + obj.tag = "NetworkAssetBundle"; + Debug.Log("[AssetBundleDownloader] Asset instantiated."); + } + } + else + { + Debug.LogWarning("[AssetBundleDownloader] No assets found in bundle."); + } + + bundle.Unload(false); // Keep loaded assets in memory + serverDownloaded = true; + } + } +} diff --git a/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs new file mode 100644 index 00000000..c17c3ec5 --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs @@ -0,0 +1,62 @@ +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.Networking; +using Fusion; +using System.Linq; + +public class AssetBundleDownloaderAndLoader : MonoBehaviour +{ + public string assetBundleUrl; + public GameObject loadedMapPrefab; + + public async Task DownloadAndPrepareMap() + { + string spaceUrl = EN.instance.spaces.FirstOrDefault()?.assetBundleRoomId?.url; + if (string.IsNullOrEmpty(spaceUrl)) + { + Debug.LogError("[Loader] No AssetBundle URL found."); + return false; + } + + assetBundleUrl = "http://194.62.43.230:8000/" + spaceUrl; + Debug.Log("[Loader] Downloading AssetBundle from: " + assetBundleUrl); + + using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle(assetBundleUrl)) + { + var operation = uwr.SendWebRequest(); + while (!operation.isDone) + await Task.Yield(); + + if (uwr.result != UnityWebRequest.Result.Success) + { + Debug.LogError("[Loader] AssetBundle download failed: " + uwr.error); + return false; + } + + AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(uwr); + if (bundle == null) + { + Debug.LogError("[Loader] Failed to load AssetBundle."); + return false; + } + + string[] assetNames = bundle.GetAllAssetNames(); + if (assetNames.Length == 0) + { + Debug.LogError("[Loader] No assets found in AssetBundle."); + return false; + } + + loadedMapPrefab = bundle.LoadAsset(assetNames[0]); + if (loadedMapPrefab == null || loadedMapPrefab.GetComponent() == null) + { + Debug.LogError("[Loader] Prefab missing or missing NetworkObject."); + return false; + } + + Debug.Log("[Loader] AssetBundle downloaded and prefab prepared."); + bundle.Unload(false); // Keep asset in memory + return true; + } + } +} diff --git a/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs.meta b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs.meta new file mode 100644 index 00000000..c0900019 --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e940b54b6013672449444115b630f774 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.meta b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.meta new file mode 100644 index 00000000..d8b3fd0c --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader/AssetBundleDownloaderAndLoader.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 308c1bcd3235bdf4c8734e142a9df82b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AssetBundleDownloader/SceneDownloader.cs b/Assets/Scripts/AssetBundleDownloader/SceneDownloader.cs new file mode 100644 index 00000000..11dd2560 --- /dev/null +++ b/Assets/Scripts/AssetBundleDownloader/SceneDownloader.cs @@ -0,0 +1,215 @@ +using System.Collections; +using System.Collections.Generic; +using RTLTMPro; +using TMPro; +using UnityEngine; +using UnityEngine.Networking; +using UnityEngine.SceneManagement; +using UnityEngine.UI; + +public class SceneDownloader : MonoBehaviour +{ + [SerializeField] private GameObject buttonPrefab; + [SerializeField] private Transform buttonParent; + + private Dictionary downloadedBundles = new(); + private Dictionary sceneNames = new(); + + void Start() + { + StartCoroutine(GenerateButtonsForSpaces()); + } + public void loadSceneManually() + { + EN.instance.selectedSpaceId = "coaching"; + } + + private IEnumerator GenerateButtonsForSpaces() + { + while (EN.instance == null || EN.instance.spaces == null || EN.instance.spaces.Count == 0) + yield return null; + + foreach (var space in EN.instance.spaces) + { + if (!string.IsNullOrEmpty(space.assetBundleRoomId?.url)) + { + string fullUrl = "http://194.62.43.230:8000/" + space.assetBundleRoomId.url; + + GameObject buttonObj = Instantiate(buttonPrefab, buttonParent); + buttonObj.name = "Button_" + space.name; + + RTLTextMeshPro btnText = buttonObj.GetComponentInChildren(); + btnText.text = space.name; + + GameObject progressPanel = buttonObj.transform.Find("progressPanel").gameObject; + TMP_Text progressText = FindTextWithTag(progressPanel, "percent"); + + progressPanel.SetActive(false); + + Button btn = buttonObj.GetComponent