From d57adf952b22cc28eeb48670f7ac3b7c8a74d158 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 5 Sep 2024 17:57:17 +0200 Subject: [PATCH 01/25] update(UZENity.Lab.asmdef): Exclude Lab from release build. --- Assets/UnZENity-Lab/Scripts/UnZENity.Lab.asmdef | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/UnZENity-Lab/Scripts/UnZENity.Lab.asmdef b/Assets/UnZENity-Lab/Scripts/UnZENity.Lab.asmdef index 63fabbfbc..a4a048b7d 100644 --- a/Assets/UnZENity-Lab/Scripts/UnZENity.Lab.asmdef +++ b/Assets/UnZENity-Lab/Scripts/UnZENity.Lab.asmdef @@ -11,7 +11,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file From d64f756f3a1da1af964fea17c788450eab0874b0 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:02:40 +0200 Subject: [PATCH 02/25] update(Lab.unity): Added DoorLockTool - skeleton. --- Assets/UnZENity-Lab/Scenes/Lab.unity | 657 ++++++++++++++++++++++++++- 1 file changed, 645 insertions(+), 12 deletions(-) diff --git a/Assets/UnZENity-Lab/Scenes/Lab.unity b/Assets/UnZENity-Lab/Scenes/Lab.unity index e6e243818..4aaa78d43 100644 --- a/Assets/UnZENity-Lab/Scenes/Lab.unity +++ b/Assets/UnZENity-Lab/Scenes/Lab.unity @@ -3378,6 +3378,165 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} m_PrefabInstance: {fileID: 606348106} m_PrefabAsset: {fileID: 0} +--- !u!1001 &620319270 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1315091982} + m_Modifications: + - target: {fileID: 20594597629701500, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Camera + value: + objectReference: {fileID: 0} + - target: {fileID: 228334215268425848, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Name + value: Legibility Mask Text + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_RootOrder + value: 21 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.x + value: 500 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.y + value: 500 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1664430050543467610, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Material + value: + objectReference: {fileID: 2100000, guid: d862c4d6d47b37348a252ad3f6139791, type: 2} + - target: {fileID: 6518928723516720666, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.x + value: -100 + objectReference: {fileID: 0} + - target: {fileID: 6518928723516720666, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.y + value: -100 + objectReference: {fileID: 0} + - target: {fileID: 6518928723516720666, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6518928723516720666, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_text + value: Locked door demo + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontSize + value: 35 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontStyle + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontSizeBase + value: 35 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_VerticalAlignment + value: 512 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_HorizontalAlignment + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: + - {fileID: 798198255077022564, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} +--- !u!224 &620319271 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + m_PrefabInstance: {fileID: 620319270} + m_PrefabAsset: {fileID: 0} --- !u!1 &638521782 GameObject: m_ObjectHideFlags: 0 @@ -3705,6 +3864,7 @@ Transform: - {fileID: 501618519} - {fileID: 1791413020} - {fileID: 408181897} + - {fileID: 2146689349} - {fileID: 1956714046} - {fileID: 747305792} - {fileID: 330949650} @@ -6631,6 +6791,111 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1231981649} m_CullTransparentMesh: 0 +--- !u!1 &1251658660 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1251658661} + - component: {fileID: 1251658664} + - component: {fileID: 1251658663} + - component: {fileID: 1251658662} + m_Layer: 0 + m_Name: Floor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1251658661 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1251658660} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 0.1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2146689349} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1251658662 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1251658660} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1251658663 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1251658660} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1251658664 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1251658660} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!1001 &1257716464 PrefabInstance: m_ObjectHideFlags: 0 @@ -6773,17 +7038,179 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} m_PrefabInstance: {fileID: 1257716464} m_PrefabAsset: {fileID: 0} ---- !u!114 &1257716466 stripped +--- !u!114 &1257716466 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + m_PrefabInstance: {fileID: 1257716464} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1315091981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1315091982} + - component: {fileID: 1315091988} + - component: {fileID: 1315091987} + - component: {fileID: 1315091986} + - component: {fileID: 1315091985} + - component: {fileID: 1315091984} + - component: {fileID: 1315091983} + m_Layer: 5 + m_Name: Menu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1315091982 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.0009999999, y: 0.0009999999, z: 0.0009999999} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 620319271} + m_Father: {fileID: 2146689349} + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 1, y: 1} + m_SizeDelta: {x: 550, y: 550} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1315091983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7951c64acb0fa62458bf30a60089fe2d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 0 + m_CheckFor2DOcclusion: 0 + m_CheckFor3DOcclusion: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RaycastTriggerInteraction: 1 +--- !u!114 &1315091984 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: d862c4d6d47b37348a252ad3f6139791, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.7490196} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: b12d44d3217c34c41bc8fa035fa687a4, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 8 +--- !u!222 &1315091985 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_CullTransparentMesh: 1 +--- !u!114 &1315091986 MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - m_PrefabInstance: {fileID: 1257716464} + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} + m_GameObject: {fileID: 1315091981} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1315091987 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &1315091988 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1315091981} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &1324751454 GameObject: m_ObjectHideFlags: 0 @@ -6892,6 +7319,37 @@ Transform: m_Children: [] m_Father: {fileID: 330949650} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1351978729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1351978730} + m_Layer: 0 + m_Name: LockpickSlot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1351978730 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1351978729} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1750343231} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1358532678 PrefabInstance: m_ObjectHideFlags: 0 @@ -9048,8 +9506,8 @@ Transform: m_GameObject: {fileID: 1608816381} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 9, y: 0, z: -2} - m_LocalScale: {x: 20, y: 0.1, z: 5} + m_LocalPosition: {x: 9, y: 0, z: -5} + m_LocalScale: {x: 20, y: 0.1, z: 10} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1956714046} @@ -9765,6 +10223,114 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} m_PrefabInstance: {fileID: 1737732587} m_PrefabAsset: {fileID: 0} +--- !u!1 &1750343230 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1750343231} + - component: {fileID: 1750343234} + - component: {fileID: 1750343233} + - component: {fileID: 1750343232} + m_Layer: 0 + m_Name: Podest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1750343231 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750343230} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.83, y: 0.39999998, z: 0.25} + m_LocalScale: {x: 0.49999988, y: 0.39999998, z: 0.49999988} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1351978730} + m_Father: {fileID: 2146689349} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &1750343232 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750343230} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1750343233 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750343230} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1750343234 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1750343230} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1757845773 GameObject: m_ObjectHideFlags: 0 @@ -10155,6 +10721,37 @@ Transform: - {fileID: 113053083} m_Father: {fileID: 1620998804} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!1 &1783100959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1783100960} + m_Layer: 0 + m_Name: DoorSlot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1783100960 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1783100959} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2146689349} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1791413019 GameObject: m_ObjectHideFlags: 0 @@ -11185,7 +11782,7 @@ Transform: m_GameObject: {fileID: 1956714044} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: -7.5, y: 0, z: -10} + m_LocalPosition: {x: -7.5, y: 0, z: -15} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -11647,18 +12244,19 @@ MonoBehaviour: MainMenuBackgroundMaterial: {fileID: 0} MainMenuSaveLoadBackgroundMaterial: {fileID: 0} MainMenuTextImageMaterial: {fileID: 0} - BackgroundMaterial: {fileID: 2100000, guid: 1e349bd46543d684da0fd00dfcc78b72, type: 2} + MenuChoiceBackMaterial: {fileID: 0} + GothicLoadingMenuMaterial: {fileID: 0} ButtonMaterial: {fileID: 2100000, guid: 731db01b086aeb94582b82a16a95775b, type: 2} SliderMaterial: {fileID: 2100000, guid: 9edb2534304dae240937e63c8a079e58, type: 2} SliderPositionMaterial: {fileID: 2100000, guid: ef75494119d9122438ca7408644d2e66, type: 2} ArrowMaterial: {fileID: 2100000, guid: dc6ce4e18c065d34f9037b5b60259872, type: 2} FillerMaterial: {fileID: 2100000, guid: 7f15366450c487344a1e66a13b22a847, type: 2} - SkyMaterial: {fileID: 2100000, guid: 39ac659c922b5b1489714aacd9b952e9, type: 2} - MapMaterial: {fileID: 0} - GothicLoadingMenuMaterial: {fileID: 0} LoadingBarBackgroundMaterial: {fileID: 0} LoadingBarMaterial: {fileID: 0} LoadingSphereMaterial: {fileID: 0} + SkyMaterial: {fileID: 2100000, guid: 39ac659c922b5b1489714aacd9b952e9, type: 2} + MapMaterial: {fileID: 0} + BackgroundMaterial: {fileID: 2100000, guid: 1e349bd46543d684da0fd00dfcc78b72, type: 2} --- !u!1 &2122853906 GameObject: m_ObjectHideFlags: 0 @@ -11795,6 +12393,41 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2122853906} m_CullTransparentMesh: 0 +--- !u!1 &2146689348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2146689349} + m_Layer: 0 + m_Name: LockTool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2146689349 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2146689348} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: -7.5, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1315091982} + - {fileID: 1251658661} + - {fileID: 1783100960} + - {fileID: 1750343231} + m_Father: {fileID: 648481967} + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 From 3890a4d4df78a1dc6c78faa13a00e1bc9e860612 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:05:48 +0200 Subject: [PATCH 03/25] move(ILabHandler): Altered to an abstract class to provide common functionality. --- .../Scripts/Handler/AbstractLabHandler.cs | 42 +++++++++++++++++++ ...ler.cs.meta => AbstractLabHandler.cs.meta} | 0 .../Scripts/Handler/ILabHandler.cs | 7 ---- .../Scripts/Handler/LabInteractableHandler.cs | 36 +--------------- .../Scripts/Handler/LabLadderHandler.cs | 5 +-- .../Scripts/Handler/LabMusicHandler.cs | 4 +- .../Scripts/Handler/LabNpcAnimationHandler.cs | 4 +- .../Scripts/Handler/LabNpcDialogHandler.cs | 4 +- .../Scripts/Handler/LabVobItemHandler.cs | 5 +-- 9 files changed, 54 insertions(+), 53 deletions(-) create mode 100644 Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs rename Assets/UnZENity-Lab/Scripts/Handler/{ILabHandler.cs.meta => AbstractLabHandler.cs.meta} (100%) delete mode 100644 Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs diff --git a/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs new file mode 100644 index 000000000..f981a1979 --- /dev/null +++ b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs @@ -0,0 +1,42 @@ +using GUZ.Core; +using GUZ.Core.Creator.Meshes.V2; +using GUZ.Core.Properties; +using GUZ.Core.Vm; +using UnityEngine; + +namespace GUZ.Lab.Handler +{ + public abstract class AbstractLabHandler : MonoBehaviour + { + public abstract void Bootstrap(); + + + protected void SpawnInteractable(string mdlName, PrefabType type, GameObject parentGo, Vector3 position = default, Quaternion rotation = default) + { + var prefab = ResourceLoader.TryGetPrefabObject(type); + var mdl = ResourceLoader.TryGetModel(mdlName); + + if (mdl == null) + { + Debug.LogError("LabInteractableHandler: Element has no .mdl file: " + mdlName); + return; + } + + MeshFactory.CreateVob(mdlName, mdl, position, rotation, + rootGo: prefab, parent: parentGo, useTextureArray: false); + } + + protected GameObject SpawnItem(string itemName, GameObject parentGo, Vector3 position = default) + { + var itemPrefab = ResourceLoader.TryGetPrefabObject(PrefabType.VobItem); + var item = VmInstanceManager.TryGetItemData(itemName); + var mrm = ResourceLoader.TryGetMultiResolutionMesh(item.Visual); + var itemGo = MeshFactory.CreateVob(item.Visual, mrm, position, default, true, + rootGo: itemPrefab, parent: parentGo, useTextureArray: false); + + itemGo.GetComponent().SetData(null, item); + + return gameObject; + } + } +} diff --git a/Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs.meta b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs.meta similarity index 100% rename from Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs.meta rename to Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs.meta diff --git a/Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs deleted file mode 100644 index aea996b78..000000000 --- a/Assets/UnZENity-Lab/Scripts/Handler/ILabHandler.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace GUZ.Lab.Handler -{ - public interface ILabHandler - { - public void Bootstrap(); - } -} diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabInteractableHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabInteractableHandler.cs index 55bd2bcc1..e91b3df61 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabInteractableHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabInteractableHandler.cs @@ -1,13 +1,9 @@ using GUZ.Core; -using GUZ.Core.Context; -using GUZ.Core.Creator.Meshes.V2; -using GUZ.Core.Properties; -using GUZ.Core.Vm; using UnityEngine; namespace GUZ.Lab.Handler { - public class LabInteractableHandler : MonoBehaviour, ILabHandler + public class LabInteractableHandler : AbstractLabHandler { public GameObject ContainersGO; public GameObject DoorsGO; @@ -17,7 +13,7 @@ public class LabInteractableHandler : MonoBehaviour, ILabHandler public GameObject InteractablesGO; public GameObject WheelsGO; - public void Bootstrap() + public override void Bootstrap() { InitOCMobDoor(); InitOCMobContainer(); @@ -79,33 +75,5 @@ private void InitOCMobWheel() SpawnInteractable("THRONE_BIG", PrefabType.VobWheel, WheelsGO, rotation: Quaternion.Euler(0, 180, 0)); SpawnInteractable("BABEBED_1", PrefabType.VobWheel, WheelsGO, new Vector3(0, 0, -4)); } - - private void SpawnInteractable(string mdlName, PrefabType type, GameObject parentGo, Vector3 position = default, Quaternion rotation = default) - { - var prefab = ResourceLoader.TryGetPrefabObject(type); - var mdl = ResourceLoader.TryGetModel(mdlName); - - if (mdl == null) - { - Debug.LogError("LabInteractableHandler: Element has no .mdl file: " + mdlName); - return; - } - - MeshFactory.CreateVob(mdlName, mdl, position, rotation, - rootGo: prefab, parent: parentGo, useTextureArray: false); - } - - private GameObject SpawnItem(string itemName, GameObject parentGo, Vector3 position = default) - { - var itemPrefab = ResourceLoader.TryGetPrefabObject(PrefabType.VobItem); - var item = VmInstanceManager.TryGetItemData(itemName); - var mrm = ResourceLoader.TryGetMultiResolutionMesh(item.Visual); - var itemGo = MeshFactory.CreateVob(item.Visual, mrm, position, default, true, - rootGo: itemPrefab, parent: parentGo, useTextureArray: false); - - itemGo.GetComponent().SetData(null, item); - - return gameObject; - } } } diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabLadderHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabLadderHandler.cs index 2a8884680..7354007d8 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabLadderHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabLadderHandler.cs @@ -1,15 +1,14 @@ using GUZ.Core; -using GUZ.Core.Context; using GUZ.Core.Creator.Meshes.V2; using UnityEngine; namespace GUZ.Lab.Handler { - public class LabLadderLabHandler : MonoBehaviour, ILabHandler + public class LabLadderLabHandler : AbstractLabHandler { public GameObject LadderSlot; - public void Bootstrap() + public override void Bootstrap() { var itemPrefab = ResourceLoader.TryGetPrefabObject(PrefabType.VobLadder); var ladderName = "LADDER_3.MDL"; diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabMusicHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabMusicHandler.cs index 7496dcec9..0bb251746 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabMusicHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabMusicHandler.cs @@ -7,12 +7,12 @@ namespace GUZ.Lab.Handler { - public class LabMusicHandler : MonoBehaviour, ILabHandler + public class LabMusicHandler : AbstractLabHandler { [FormerlySerializedAs("fileSelector")] public TMP_Dropdown FileSelector; - public void Bootstrap() + public override void Bootstrap() { var vm = ResourceLoader.TryGetDaedalusVm("MUSIC"); diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabNpcAnimationHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabNpcAnimationHandler.cs index 432378d91..1db5b8166 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabNpcAnimationHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabNpcAnimationHandler.cs @@ -18,7 +18,7 @@ namespace GUZ.Lab.Handler { - public class LabNpcAnimationHandler : MonoBehaviour, ILabHandler + public class LabNpcAnimationHandler : AbstractLabHandler { [FormerlySerializedAs("npcDropdown")] public TMP_Dropdown NpcDropdown; @@ -105,7 +105,7 @@ public class LabNpcAnimationHandler : MonoBehaviour, ILabHandler } }; - public void Bootstrap() + public override void Bootstrap() { NpcDropdown.options = _npcs.Keys.Select(item => new TMP_Dropdown.OptionData(item)).ToList(); AnimationDropdown.options = _animations.Keys.Select(item => new TMP_Dropdown.OptionData(item)).ToList(); diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabNpcDialogHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabNpcDialogHandler.cs index 8e40b4e1b..ed806fbba 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabNpcDialogHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabNpcDialogHandler.cs @@ -11,7 +11,7 @@ namespace GUZ.Lab.Handler { - public class LabNpcDialogHandler : MonoBehaviour, ILabHandler + public class LabNpcDialogHandler : AbstractLabHandler { public GameObject NpcSlotGo; @@ -19,7 +19,7 @@ public class LabNpcDialogHandler : MonoBehaviour, ILabHandler private NpcInstance _bloodwynInstance; - public void Bootstrap() + public override void Bootstrap() { BootstrapBloodwyn(); } diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabVobItemHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabVobItemHandler.cs index 76d1cd09b..4b4708f26 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabVobItemHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabVobItemHandler.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using GUZ.Core; -using GUZ.Core.Context; using GUZ.Core.Creator.Meshes.V2; using GUZ.Core.Globals; using GUZ.Core.Properties; @@ -14,7 +13,7 @@ namespace GUZ.Lab.Handler { - public class LabVobItemHandler : MonoBehaviour, ILabHandler + public class LabVobItemHandler : AbstractLabHandler { public TMP_Dropdown VobCategoryDropdown; @@ -26,7 +25,7 @@ public class LabVobItemHandler : MonoBehaviour, ILabHandler private Dictionary _items = new(); - public void Bootstrap() + public override void Bootstrap() { /* * 1. Load Vdfs From 7ff5ecc01a74a3e1827a76511ce4e0f467689261 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:03:28 +0200 Subject: [PATCH 04/25] add(LabLockHandler): Initial setup of Locked door and Lockpick --- Assets/UnZENity-Lab/Scenes/Lab.unity | 82 ++++++++++++++++++- .../Scripts/Handler/LabLockHandler.cs | 17 ++++ .../Scripts/Handler/LabLockHandler.cs.meta | 3 + .../UnZENity-Lab/Scripts/LabBootstrapper.cs | 9 +- 4 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs create mode 100644 Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs.meta diff --git a/Assets/UnZENity-Lab/Scenes/Lab.unity b/Assets/UnZENity-Lab/Scenes/Lab.unity index 4aaa78d43..a83dbad1c 100644 --- a/Assets/UnZENity-Lab/Scenes/Lab.unity +++ b/Assets/UnZENity-Lab/Scenes/Lab.unity @@ -228,6 +228,63 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 3931899018356448435, guid: 565136863683f59469de76718dbbfb65, type: 3} m_PrefabInstance: {fileID: 42175755} m_PrefabAsset: {fileID: 0} +--- !u!1 &84372835 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 84372836} + - component: {fileID: 84372838} + - component: {fileID: 84372837} + m_Layer: 0 + m_Name: ModuleBootstrap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &84372836 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 84372835} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2101890269} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &84372837 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 84372835} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa9520d075b24c4e98b3ec05857c204f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &84372838 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 84372835} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 36c6650e16f74e819884826f6e18a047, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &91929453 PrefabInstance: m_ObjectHideFlags: 0 @@ -7329,7 +7386,7 @@ GameObject: m_Component: - component: {fileID: 1351978730} m_Layer: 0 - m_Name: LockpickSlot + m_Name: LockPickSlot m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -10251,8 +10308,8 @@ Transform: m_GameObject: {fileID: 1750343230} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0.83, y: 0.39999998, z: 0.25} - m_LocalScale: {x: 0.49999988, y: 0.39999998, z: 0.49999988} + m_LocalPosition: {x: 1, y: 0.3, z: 0.25} + m_LocalScale: {x: 0.5, y: 0.3, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1351978730} @@ -12191,7 +12248,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 84372836} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2101890270 @@ -12213,6 +12271,7 @@ MonoBehaviour: LadderLabHandler: {fileID: 747305793} VobItemHandler: {fileID: 330949651} LabNpcAnimationHandler: {fileID: 501618520} + LabLockHandler: {fileID: 2146689350} --- !u!114 &2101890271 MonoBehaviour: m_ObjectHideFlags: 0 @@ -12402,6 +12461,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2146689349} + - component: {fileID: 2146689350} m_Layer: 0 m_Name: LockTool m_TagString: Untagged @@ -12428,6 +12488,20 @@ Transform: - {fileID: 1750343231} m_Father: {fileID: 648481967} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!114 &2146689350 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2146689348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c9df1dc49cc4f09ab20efa402e2e04e, type: 3} + m_Name: + m_EditorClassIdentifier: + _doorSlot: {fileID: 1783100959} + _lockPickSlot: {fileID: 1351978729} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs new file mode 100644 index 000000000..3e21c04d2 --- /dev/null +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs @@ -0,0 +1,17 @@ +using GUZ.Core; +using UnityEngine; + +namespace GUZ.Lab.Handler +{ + public class LabLockHandler : AbstractLabHandler + { + [SerializeField] private GameObject _doorSlot; + [SerializeField] private GameObject _lockPickSlot; + + + public override void Bootstrap() + { + SpawnInteractable("DOOR_WOODEN", PrefabType.VobDoor, _doorSlot); + } + } +} diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs.meta b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs.meta new file mode 100644 index 000000000..7f39bbafd --- /dev/null +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6c9df1dc49cc4f09ab20efa402e2e04e +timeCreated: 1725552180 \ No newline at end of file diff --git a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs index 14e8e5036..c9c74f4d3 100644 --- a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs +++ b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs @@ -20,17 +20,13 @@ public class LabBootstrapper : MonoBehaviour, IGlobalDataProvider, ICoroutineMan public GameConfiguration Config { get; private set; } public LabMusicHandler LabMusicHandler; - public LabNpcDialogHandler NpcDialogHandler; - public LabInteractableHandler InteractableHandler; - public LabLadderLabHandler LadderLabHandler; - public LabVobItemHandler VobItemHandler; - public LabNpcAnimationHandler LabNpcAnimationHandler; - + public LabLockHandler LabLockHandler; + private VRDeviceSimulatorManager _deviceSimulatorManager; private MusicManager _gameMusicManager; private RoutineManager _npcRoutineManager; @@ -95,6 +91,7 @@ private void Update() InteractableHandler.Bootstrap(); LadderLabHandler.Bootstrap(); VobItemHandler.Bootstrap(); + LabLockHandler.Bootstrap(); } private void BootLab() From 5a924bbd9a79458279b2fa67c8e92c49fd2d6810 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:39:23 +0200 Subject: [PATCH 05/25] update(Lab.unity): move LockTool to separate space. --- Assets/UnZENity-Lab/Scenes/Lab.unity | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/UnZENity-Lab/Scenes/Lab.unity b/Assets/UnZENity-Lab/Scenes/Lab.unity index 93c4840ae..33933bb75 100644 --- a/Assets/UnZENity-Lab/Scenes/Lab.unity +++ b/Assets/UnZENity-Lab/Scenes/Lab.unity @@ -4204,10 +4204,10 @@ Transform: - {fileID: 1791413020} - {fileID: 408181897} - {fileID: 1219449893} - - {fileID: 1956714046} - {fileID: 747305792} - - {fileID: 640496638} - {fileID: 330949650} + - {fileID: 640496638} + - {fileID: 1956714046} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &653127295 @@ -13266,7 +13266,7 @@ Transform: m_GameObject: {fileID: 1956714044} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: -7.5, y: 0, z: -10} + m_LocalPosition: {x: -7.5, y: 0, z: -15} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: From 61bfebf7194af594fabe6152e324f3d7ccf4a04b Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:00:47 +0200 Subject: [PATCH 06/25] add(LockPick.prefab): ocItem for LockPick is now new prefab variant + dragging element into/out of lock area is recognized. --- .../Scripts/Globals/Constants.cs | 7 + Assets/UnZENity-Core/Scripts/PrefabType.cs | 8 +- .../Scripts/Handler/AbstractLabHandler.cs | 6 +- .../Scripts/Handler/LabLockHandler.cs | 6 +- .../Resources/VR/Prefabs/Vobs/oCItem.meta | 8 + .../VR/Prefabs/Vobs/oCItem/LockPick.prefab | 158 ++++++++++++++ .../Prefabs/Vobs/oCItem/LockPick.prefab.meta | 7 + .../VR/Prefabs/Vobs/oCMobDoor.prefab | 198 ++++++++++++++++++ .../Scripts/Components/VRVobItem.cs | 2 +- .../VRVobContainerSocketInventory.cs | 4 +- .../Scripts/Components/VobDoor.meta | 3 + .../Components/VobDoor/VRLockInteraction.cs | 42 ++++ .../VobDoor/VRLockInteraction.cs.meta | 3 + ...emProperties.cs => VRVobItemProperties.cs} | 2 +- ...es.cs.meta => VRVobItemProperties.cs.meta} | 0 .../Scripts/Properties/VobItem.meta | 3 + .../VobItem/VRVobLockPickProperties.cs | 7 + .../VobItem/VRVobLockPickProperties.cs.meta | 3 + 18 files changed, 455 insertions(+), 12 deletions(-) create mode 100644 Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem.meta create mode 100644 Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab create mode 100644 Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab.meta create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobDoor.meta create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta rename Assets/UnZENity-VR/Scripts/Properties/{HVRVobItemProperties.cs => VRVobItemProperties.cs} (64%) rename Assets/UnZENity-VR/Scripts/Properties/{HVRVobItemProperties.cs.meta => VRVobItemProperties.cs.meta} (100%) create mode 100644 Assets/UnZENity-VR/Scripts/Properties/VobItem.meta create mode 100644 Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs create mode 100644 Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs.meta diff --git a/Assets/UnZENity-Core/Scripts/Globals/Constants.cs b/Assets/UnZENity-Core/Scripts/Globals/Constants.cs index f41f7953b..57608e517 100644 --- a/Assets/UnZENity-Core/Scripts/Globals/Constants.cs +++ b/Assets/UnZENity-Core/Scripts/Globals/Constants.cs @@ -10,6 +10,13 @@ public static class GothicIni private const string _gameSection = "GAME"; public static bool PlayLogoVideos => GameGlobals.Settings.GothicIniSettings[_gameSection].TryGetValue("playLogoVideos", out var value) ? Convert.ToBoolean(Convert.ToInt16(value)) : true; } + + public static class Daedalus + { + public static string PicklockSuccessSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_SUCCESS").GetString(0); + public static string PicklockFailureSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_FAILURE").GetString(0); + public static string PicklockBrokenSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_BROKEN").GetString(0); + } public static readonly Material LoadingMaterial; // Used for Vobs and World before applying TextureArray. diff --git a/Assets/UnZENity-Core/Scripts/PrefabType.cs b/Assets/UnZENity-Core/Scripts/PrefabType.cs index 18bac9655..4472f9584 100644 --- a/Assets/UnZENity-Core/Scripts/PrefabType.cs +++ b/Assets/UnZENity-Core/Scripts/PrefabType.cs @@ -8,7 +8,6 @@ public enum PrefabType Vob, Npc, VobAnimate, - VobItem, VobContainer, VobDoor, VobFire, @@ -24,6 +23,9 @@ public enum PrefabType VobSoundDaytime, VobLadder, + VobItem, + VobItemLockPick, + Player, MainMenu, XRDeviceSimulator, @@ -40,7 +42,6 @@ public static string Path(this PrefabType type) PrefabType.Vob => "Prefabs/Vobs/Vob", PrefabType.Npc => "Prefabs/Vobs/oCNpc", PrefabType.VobAnimate => "Prefabs/Vobs/zCVobAnimate", - PrefabType.VobItem => "Prefabs/Vobs/oCItem", PrefabType.VobContainer => "Prefabs/Vobs/oCMobContainer", PrefabType.VobDoor => "Prefabs/Vobs/oCMobDoor", PrefabType.VobFire => "Prefabs/Vobs/oCMobFire", @@ -56,6 +57,9 @@ public static string Path(this PrefabType type) PrefabType.VobSoundDaytime => "Prefabs/Vobs/zCVobSoundDaytime", PrefabType.VobLadder => "Prefabs/Vobs/oCMobLadder", + PrefabType.VobItem => "Prefabs/Vobs/oCItem", + PrefabType.VobItemLockPick => "Prefabs/Vobs/oCItem/LockPick", + PrefabType.Player => "Prefabs/Player", PrefabType.MainMenu => "Prefabs/Menus/MainMenu", PrefabType.XRDeviceSimulator => "Prefabs/VRPlayer/XR Device Simulator", diff --git a/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs index f981a1979..f9c4e1a9e 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs @@ -26,15 +26,15 @@ protected void SpawnInteractable(string mdlName, PrefabType type, GameObject par rootGo: prefab, parent: parentGo, useTextureArray: false); } - protected GameObject SpawnItem(string itemName, GameObject parentGo, Vector3 position = default) + protected GameObject SpawnItem(string itemName, GameObject parentGo, Vector3 position = default, PrefabType type = PrefabType.VobItem) { - var itemPrefab = ResourceLoader.TryGetPrefabObject(PrefabType.VobItem); + var itemPrefab = ResourceLoader.TryGetPrefabObject(type); var item = VmInstanceManager.TryGetItemData(itemName); var mrm = ResourceLoader.TryGetMultiResolutionMesh(item.Visual); var itemGo = MeshFactory.CreateVob(item.Visual, mrm, position, default, true, rootGo: itemPrefab, parent: parentGo, useTextureArray: false); - itemGo.GetComponent().SetData(null, item); + itemGo.GetComponentInChildren().SetData(null, item); return gameObject; } diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs index 482e8752d..9f86c5344 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs @@ -7,12 +7,12 @@ public class LabLockHandler : AbstractLabHandler { [SerializeField] private GameObject _doorSlot; [SerializeField] private GameObject _lockPickSlot; - - + + public override void Bootstrap() { SpawnInteractable("DOOR_WOODEN", PrefabType.VobDoor, _doorSlot); - SpawnItem("ItKeLockpick", _lockPickSlot, new (0, -0.5f, 0)); + SpawnItem("ItKeLockpick", _lockPickSlot, new(0, -0.5f, 0), PrefabType.VobItemLockPick); } } } diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem.meta b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem.meta new file mode 100644 index 000000000..f23a0f208 --- /dev/null +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e89576e02f3f84f4e94e91c539aa00e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab new file mode 100644 index 000000000..e79fe6016 --- /dev/null +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab @@ -0,0 +1,158 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &544614297848919989 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3031827932900581029} + - component: {fileID: 4037197534674816054} + m_Layer: 0 + m_Name: LockInteractionCollider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3031827932900581029 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 544614297848919989} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6888142504213485964} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!136 &4037197534674816054 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 544614297848919989} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.05 + m_Height: 0.25 + m_Direction: 2 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &4870745355113969343 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3848800049239021948, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_IsTrigger + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6503575194566409312, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: m_Name + value: LockPick + objectReference: {fileID: 0} + - target: {fileID: 6759220176799969513, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: _properties + value: + objectReference: {fileID: 6536433147659353257} + - target: {fileID: 8543334853728962911, guid: b8c776d1865a6014385673931a399ebc, type: 3} + propertyPath: _properties + value: + objectReference: {fileID: 6536433147659353257} + m_RemovedComponents: + - {fileID: 6221555039147954839, guid: b8c776d1865a6014385673931a399ebc, type: 3} + m_RemovedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + insertIndex: 0 + addedObject: {fileID: 3031827932900581029} + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 6503575194566409312, guid: b8c776d1865a6014385673931a399ebc, type: 3} + insertIndex: 3 + addedObject: {fileID: 6536433147659353257} + m_SourcePrefab: {fileID: 100100000, guid: b8c776d1865a6014385673931a399ebc, type: 3} +--- !u!1 &1862531150101056223 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6503575194566409312, guid: b8c776d1865a6014385673931a399ebc, type: 3} + m_PrefabInstance: {fileID: 4870745355113969343} + m_PrefabAsset: {fileID: 0} +--- !u!114 &6536433147659353257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1862531150101056223} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5b286a6d3f574029ae48428e93591d28, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: + IsSocketed: 0 + IsInsideLock: 0 +--- !u!4 &6888142504213485964 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2022050282646122291, guid: b8c776d1865a6014385673931a399ebc, type: 3} + m_PrefabInstance: {fileID: 4870745355113969343} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab.meta b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab.meta new file mode 100644 index 000000000..374355434 --- /dev/null +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b2b3b1c1b969fc34e83166285814be0d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab index 12e19282e..20f15db7f 100644 --- a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab @@ -316,6 +316,134 @@ MonoBehaviour: PreviousClosed: 0 VerboseLogging: 0 Locked: 0 +--- !u!1 &1222579370199367537 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3138642016578506713} + - component: {fileID: 4670513280573296585} + m_Layer: 0 + m_Name: Audio Source + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3138642016578506713 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1222579370199367537} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2022050282646122291} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &4670513280573296585 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1222579370199367537} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &3186185643031684119 GameObject: m_ObjectHideFlags: 0 @@ -348,6 +476,74 @@ Transform: - {fileID: 5222818422143470236} m_Father: {fileID: 2022050282646122291} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &3397705996622112300 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6051831693481761152} + - component: {fileID: 4385990735154456048} + - component: {fileID: 827370569709809547} + m_Layer: 0 + m_Name: LockInteraction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6051831693481761152 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3397705996622112300} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.25, y: 0.75, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2022050282646122291} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4385990735154456048 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3397705996622112300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9d17628e45ec40eda22323a8f4579285, type: 3} + m_Name: + m_EditorClassIdentifier: + _properties: {fileID: 2607151182155886275} + _audioSource: {fileID: 4670513280573296585} +--- !u!135 &827370569709809547 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3397705996622112300} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &6228530951545921686 GameObject: m_ObjectHideFlags: 0 @@ -515,6 +711,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 3138642016578506713} + - {fileID: 6051831693481761152} - {fileID: 8018092039133297413} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs index b5af68559..7d449cfef 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs @@ -13,7 +13,7 @@ namespace GUZ.VR.Components { public class VRVobItem : MonoBehaviour { - [SerializeField] private HVRVobItemProperties _properties; + [SerializeField] private VRVobItemProperties _properties; [SerializeField] private MeshCollider _meshCollider; // We pre-allocate enough entries to fetch at least one entry which is not ourselves. diff --git a/Assets/UnZENity-VR/Scripts/Components/VobContainer/VRVobContainerSocketInventory.cs b/Assets/UnZENity-VR/Scripts/Components/VobContainer/VRVobContainerSocketInventory.cs index 0cdecbe01..8410bea66 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobContainer/VRVobContainerSocketInventory.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobContainer/VRVobContainerSocketInventory.cs @@ -14,12 +14,12 @@ public class VRVobContainerSocketInventory : MonoBehaviour public void OnBeforeGrabbed(HVRGrabberBase grabber, HVRGrabbable grabbable) { - grabbable.GetComponent().IsSocketed = true; + grabbable.GetComponent().IsSocketed = true; } public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) { - grabbable.GetComponent().IsSocketed = false; + grabbable.GetComponent().IsSocketed = false; } } diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor.meta b/Assets/UnZENity-VR/Scripts/Components/VobDoor.meta new file mode 100644 index 000000000..fa424db7f --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5a83384ca4114562a9b4607879e81779 +timeCreated: 1726156009 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs new file mode 100644 index 000000000..40eed3276 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs @@ -0,0 +1,42 @@ +using GUZ.Core.Creator.Sounds; +using GUZ.Core.Globals; +using GUZ.Core.Properties; +using GUZ.VR.Properties.VobItem; +using Unity.VisualScripting.TextureAssets; +using UnityEngine; +using ResourceLoader = GUZ.Core.ResourceLoader; + +namespace GUZ.VR.Components.VobDoor +{ + public class VRLockInteraction : MonoBehaviour + { + [SerializeField] private VobDoorProperties _properties; + [SerializeField] private AudioSource _audioSource; + + private const string _lockInteractionColliderName = "LockInteractionCollider"; + + private void OnTriggerEnter(Collider other) + { + if (!other.gameObject.name.Equals(_lockInteractionColliderName)) + { + return; + } + + _audioSource.PlayOneShot(SoundCreator.ToAudioClip(ResourceLoader.TryGetSound(Constants.Daedalus.PicklockFailureSoundName))); + + other.gameObject.GetComponentInParent().IsInsideLock = true; + } + + private void OnTriggerExit(Collider other) + { + if (!other.gameObject.name.Equals(_lockInteractionColliderName)) + { + return; + } + + _audioSource.PlayOneShot(SoundCreator.ToAudioClip(ResourceLoader.TryGetSound(Constants.Daedalus.PicklockFailureSoundName))); + + other.gameObject.GetComponentInParent().IsInsideLock = false; + } + } +} diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta new file mode 100644 index 000000000..9c5100e64 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9d17628e45ec40eda22323a8f4579285 +timeCreated: 1726156016 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Properties/HVRVobItemProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs similarity index 64% rename from Assets/UnZENity-VR/Scripts/Properties/HVRVobItemProperties.cs rename to Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs index 638c09c4b..f180aad17 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/HVRVobItemProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs @@ -2,7 +2,7 @@ namespace GUZ.VR.Properties { - public class HVRVobItemProperties : VobItemProperties + public class VRVobItemProperties : VobItemProperties { public bool IsSocketed; } diff --git a/Assets/UnZENity-VR/Scripts/Properties/HVRVobItemProperties.cs.meta b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs.meta similarity index 100% rename from Assets/UnZENity-VR/Scripts/Properties/HVRVobItemProperties.cs.meta rename to Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem.meta b/Assets/UnZENity-VR/Scripts/Properties/VobItem.meta new file mode 100644 index 000000000..123e34050 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a0a6adafa2c1415f9ccb1b9666485b68 +timeCreated: 1726173522 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs new file mode 100644 index 000000000..3e419eb6e --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs @@ -0,0 +1,7 @@ +namespace GUZ.VR.Properties.VobItem +{ + public class VRVobLockPickProperties : VRVobItemProperties + { + public bool IsInsideLock; + } +} diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs.meta b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs.meta new file mode 100644 index 000000000..18ad9740a --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5b286a6d3f574029ae48428e93591d28 +timeCreated: 1726173544 \ No newline at end of file From bbd07e1eda14aa7306a310b63ff8c984aa9d9091 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:22:48 +0200 Subject: [PATCH 07/25] fix(VRVobItem): OnDrawGizmos threw exceptions. Added isPlaying check to remove issue. --- Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs index 7d449cfef..b95185a50 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs @@ -82,7 +82,7 @@ public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) /// private void OnDrawGizmos() { - if (!GameGlobals.Config.ShowCapsuleOverlapGizmos) + if (!Application.isPlaying || !GameGlobals.Config.ShowCapsuleOverlapGizmos) { return; } From 9b68aa61900813ed7104208b28499b1121872684 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:43:21 +0200 Subject: [PATCH 08/25] add(VRLockPickInteraction): skeleton to check for hand rotation of lockpick later on. --- .../VR/Prefabs/Vobs/oCItem/LockPick.prefab | 17 ++++++++++- .../Scripts/Components/VRVobItem.cs | 11 +++++++ ...nteraction.cs => VRDoorLockInteraction.cs} | 5 ++-- ....cs.meta => VRDoorLockInteraction.cs.meta} | 0 .../Scripts/Components/VobItem.meta | 3 ++ .../VobItem/VRLockPickInteraction.cs | 29 +++++++++++++++++++ .../VobItem/VRLockPickInteraction.cs.meta | 3 ++ .../Scripts/Properties/VRVobItemProperties.cs | 12 +++++++- 8 files changed, 75 insertions(+), 5 deletions(-) rename Assets/UnZENity-VR/Scripts/Components/VobDoor/{VRLockInteraction.cs => VRDoorLockInteraction.cs} (92%) rename Assets/UnZENity-VR/Scripts/Components/VobDoor/{VRLockInteraction.cs.meta => VRDoorLockInteraction.cs.meta} (100%) create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobItem.meta create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs create mode 100644 Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs.meta diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab index e79fe6016..ba478c86e 100644 --- a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCItem/LockPick.prefab @@ -9,9 +9,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3031827932900581029} + - component: {fileID: 3194424282553901452} - component: {fileID: 4037197534674816054} m_Layer: 0 - m_Name: LockInteractionCollider + m_Name: LockPickInteraction m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -32,6 +33,19 @@ Transform: m_Children: [] m_Father: {fileID: 6888142504213485964} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3194424282553901452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 544614297848919989} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4919dad497a947d3ad157bd37d8309c3, type: 3} + m_Name: + m_EditorClassIdentifier: + _properties: {fileID: 6536433147659353257} --- !u!136 &4037197534674816054 CapsuleCollider: m_ObjectHideFlags: 0 @@ -150,6 +164,7 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: IsSocketed: 0 + CurrentGrabStatus: 0 IsInsideLock: 0 --- !u!4 &6888142504213485964 stripped Transform: diff --git a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs index b95185a50..6004d7d0b 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs @@ -65,6 +65,10 @@ public void OnGrabbed(HVRGrabberBase grabber, HVRGrabbable grabbable) } GameGlobals.VobMeshCulling?.StartTrackVobPositionUpdates(gameObject); + + _properties.CurrentGrabStatus |= grabber.GetComponentInParent().IsLeftHand + ? VRVobItemProperties.GrabStatus.LeftHand + : VRVobItemProperties.GrabStatus.RightHand; } public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) @@ -75,6 +79,13 @@ public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) // Disable "ghostification" of object. DynamicMaterialManager.ResetDynamicValue(gameObject, Constants.ShaderPropertyTransparency, Constants.ShaderPropertyTransparencyDefault); + + GameGlobals.VobMeshCulling?.StartTrackVobPositionUpdates(gameObject); + + // Remove flag of hand which released only. + _properties.CurrentGrabStatus &= grabber.GetComponentInParent().IsLeftHand + ? ~VRVobItemProperties.GrabStatus.LeftHand + : ~VRVobItemProperties.GrabStatus.RightHand; } /// diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs similarity index 92% rename from Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs rename to Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index 40eed3276..20aab2c63 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -2,18 +2,17 @@ using GUZ.Core.Globals; using GUZ.Core.Properties; using GUZ.VR.Properties.VobItem; -using Unity.VisualScripting.TextureAssets; using UnityEngine; using ResourceLoader = GUZ.Core.ResourceLoader; namespace GUZ.VR.Components.VobDoor { - public class VRLockInteraction : MonoBehaviour + public class VRDoorLockInteraction : MonoBehaviour { [SerializeField] private VobDoorProperties _properties; [SerializeField] private AudioSource _audioSource; - private const string _lockInteractionColliderName = "LockInteractionCollider"; + private const string _lockInteractionColliderName = "LockPickInteraction"; private void OnTriggerEnter(Collider other) { diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs.meta similarity index 100% rename from Assets/UnZENity-VR/Scripts/Components/VobDoor/VRLockInteraction.cs.meta rename to Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem.meta b/Assets/UnZENity-VR/Scripts/Components/VobItem.meta new file mode 100644 index 000000000..25296e810 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8b706a2bd1d5470a89ac764dab52ff72 +timeCreated: 1726180608 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs new file mode 100644 index 000000000..591c1b4f8 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -0,0 +1,29 @@ +using GUZ.VR.Properties.VobItem; +using UnityEngine; + +namespace GUZ.VR.Components.VobItem +{ + public class VRLockPickInteraction : MonoBehaviour + { + [SerializeField] private VRVobLockPickProperties _properties; + + private void Update() + { + if (!_properties.IsInsideLock) + { + return; + } + + + } + + private void CalculateRotation() + { + /** + * 0. Set start rotation of hand(s) which grab item. (As we have 2 hands, we need to check via array[2] for both items always! + * 1.a If rotation is ~45° right - trigger right-information to currently active door + * 1.b ~45° left - same + */ + } + } +} diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs.meta b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs.meta new file mode 100644 index 000000000..0e49d6c08 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4919dad497a947d3ad157bd37d8309c3 +timeCreated: 1726180618 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs index f180aad17..86e60da6b 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs @@ -1,9 +1,19 @@ -using GUZ.Core.Properties; +using System; +using GUZ.Core.Properties; namespace GUZ.VR.Properties { public class VRVobItemProperties : VobItemProperties { public bool IsSocketed; + public GrabStatus CurrentGrabStatus = GrabStatus.None; + + [Flags] + public enum GrabStatus + { + None, + LeftHand, + RightHand + } } } From 4e8dd5b65573c0519e92813616974b2e2c79a0d5 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sat, 14 Sep 2024 22:12:32 +0200 Subject: [PATCH 09/25] move(Adapter+Manager): Put into sub folders. --- Assets/UnZENity-VR/Scripts/Adapter.meta | 3 +++ .../Scripts/{ => Adapter}/VRDialogAdapter.cs | 2 +- .../Scripts/{ => Adapter}/VRDialogAdapter.cs.meta | 0 .../Scripts/{ => Adapter}/VRInteractionAdapter.cs | 7 ++++--- .../Scripts/{ => Adapter}/VRInteractionAdapter.cs.meta | 0 .../{VRPlayerManager.cs => VRCanvasManager.cs} | 2 +- ...VRPlayerManager.cs.meta => VRCanvasManager.cs.meta} | 0 Assets/UnZENity-VR/Scripts/Manager.meta | 3 +++ Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs | 10 ++++++++++ .../Scripts/Manager/VRPlayerManager.cs.meta | 3 +++ Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs | 1 + 11 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 Assets/UnZENity-VR/Scripts/Adapter.meta rename Assets/UnZENity-VR/Scripts/{ => Adapter}/VRDialogAdapter.cs (98%) rename Assets/UnZENity-VR/Scripts/{ => Adapter}/VRDialogAdapter.cs.meta (100%) rename Assets/UnZENity-VR/Scripts/{ => Adapter}/VRInteractionAdapter.cs (95%) rename Assets/UnZENity-VR/Scripts/{ => Adapter}/VRInteractionAdapter.cs.meta (100%) rename Assets/UnZENity-VR/Scripts/Components/{VRPlayerManager.cs => VRCanvasManager.cs} (91%) rename Assets/UnZENity-VR/Scripts/Components/{VRPlayerManager.cs.meta => VRCanvasManager.cs.meta} (100%) create mode 100644 Assets/UnZENity-VR/Scripts/Manager.meta create mode 100644 Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs create mode 100644 Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/Adapter.meta b/Assets/UnZENity-VR/Scripts/Adapter.meta new file mode 100644 index 000000000..2ed7b02a5 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Adapter.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bf387544e00f4a9a9be746b1174373e9 +timeCreated: 1726343984 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/VRDialogAdapter.cs b/Assets/UnZENity-VR/Scripts/Adapter/VRDialogAdapter.cs similarity index 98% rename from Assets/UnZENity-VR/Scripts/VRDialogAdapter.cs rename to Assets/UnZENity-VR/Scripts/Adapter/VRDialogAdapter.cs index 387dd640a..9d66d4441 100644 --- a/Assets/UnZENity-VR/Scripts/VRDialogAdapter.cs +++ b/Assets/UnZENity-VR/Scripts/Adapter/VRDialogAdapter.cs @@ -9,7 +9,7 @@ using UnityEngine.SceneManagement; using ZenKit.Daedalus; -namespace GUZ.VR +namespace GUZ.VR.Adapter { public class VRDialogAdapter : IDialogAdapter { diff --git a/Assets/UnZENity-VR/Scripts/VRDialogAdapter.cs.meta b/Assets/UnZENity-VR/Scripts/Adapter/VRDialogAdapter.cs.meta similarity index 100% rename from Assets/UnZENity-VR/Scripts/VRDialogAdapter.cs.meta rename to Assets/UnZENity-VR/Scripts/Adapter/VRDialogAdapter.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/VRInteractionAdapter.cs b/Assets/UnZENity-VR/Scripts/Adapter/VRInteractionAdapter.cs similarity index 95% rename from Assets/UnZENity-VR/Scripts/VRInteractionAdapter.cs rename to Assets/UnZENity-VR/Scripts/Adapter/VRInteractionAdapter.cs index de4ff7e8a..fb2549021 100644 --- a/Assets/UnZENity-VR/Scripts/VRInteractionAdapter.cs +++ b/Assets/UnZENity-VR/Scripts/Adapter/VRInteractionAdapter.cs @@ -5,13 +5,14 @@ using GUZ.Core.Extensions; using GUZ.Core.Globals; using GUZ.VR.Components; +using HurricaneVR.Framework.Core; using HurricaneVRExtensions.Simulator; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.XR.Interaction.Toolkit; using PrefabType = GUZ.Core.PrefabType; -namespace GUZ.VR +namespace GUZ.VR.Adapter { public class VRInteractionAdapter : IInteractionAdapter { @@ -79,8 +80,8 @@ public void CreateVRDeviceSimulator() } var simulatorGo = new GameObject("HVR - XRDeviceSimulator"); - // We assume, that this Component (HVRPlayerManager) is set inside the HVR root for a player rig. - var playerRig = currentScene.GetRootGameObjects().First(i => i.GetComponentInChildren()); + // We assume, that this Component (HVRManager) is set inside the HVR root for a player rig. + var playerRig = currentScene.GetRootGameObjects().First(i => i.GetComponentInChildren()); simulatorGo.AddComponent().Rig = playerRig; simulatorGo.AddComponent().Rig = playerRig; diff --git a/Assets/UnZENity-VR/Scripts/VRInteractionAdapter.cs.meta b/Assets/UnZENity-VR/Scripts/Adapter/VRInteractionAdapter.cs.meta similarity index 100% rename from Assets/UnZENity-VR/Scripts/VRInteractionAdapter.cs.meta rename to Assets/UnZENity-VR/Scripts/Adapter/VRInteractionAdapter.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/Components/VRPlayerManager.cs b/Assets/UnZENity-VR/Scripts/Components/VRCanvasManager.cs similarity index 91% rename from Assets/UnZENity-VR/Scripts/Components/VRPlayerManager.cs rename to Assets/UnZENity-VR/Scripts/Components/VRCanvasManager.cs index e1cf1f4d4..1b494637b 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRPlayerManager.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRCanvasManager.cs @@ -6,7 +6,7 @@ namespace GUZ.VR.Components { - public class VRPlayerManager : SingletonBehaviour + public class VRCanvasManager : SingletonBehaviour { private void Start() { diff --git a/Assets/UnZENity-VR/Scripts/Components/VRPlayerManager.cs.meta b/Assets/UnZENity-VR/Scripts/Components/VRCanvasManager.cs.meta similarity index 100% rename from Assets/UnZENity-VR/Scripts/Components/VRPlayerManager.cs.meta rename to Assets/UnZENity-VR/Scripts/Components/VRCanvasManager.cs.meta diff --git a/Assets/UnZENity-VR/Scripts/Manager.meta b/Assets/UnZENity-VR/Scripts/Manager.meta new file mode 100644 index 000000000..ccdf4d86f --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Manager.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d01811d583b340f496642bcd3d84cc77 +timeCreated: 1726344018 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs new file mode 100644 index 000000000..28b89d0a0 --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs @@ -0,0 +1,10 @@ +namespace GUZ.VR.Manager +{ + /// + /// Contains global states about Hurricane VR player. + /// + public static class VRPlayerManager + { + + } +} diff --git a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs.meta b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs.meta new file mode 100644 index 000000000..50d243b7e --- /dev/null +++ b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f4c4e9e393c644378e0efc9473d68b32 +timeCreated: 1726344397 \ No newline at end of file diff --git a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs index 1a7db649e..ddebc1e31 100644 --- a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs +++ b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs @@ -1,4 +1,5 @@ using GUZ.Core.Context; +using GUZ.VR.Adapter; #if !GUZ_HVR_INSTALLED using System; #endif From 44933f0e2d6cfc32aaead0211df6c7b3895b87ad Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sat, 14 Sep 2024 22:35:10 +0200 Subject: [PATCH 10/25] add(VRPlayerManager): Initial "rotation tracking" of grabbed LockPick implemented. Rotation isn't calculated correctly though. --- .../Scripts/Components/VRVobItem.cs | 12 ++----- .../VobItem/VRLockPickInteraction.cs | 27 +++++++++++++-- .../Scripts/Manager/VRPlayerManager.cs | 33 ++++++++++++++++++- .../Scripts/Properties/VRVobItemProperties.cs | 12 +------ 4 files changed, 61 insertions(+), 23 deletions(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs index 6004d7d0b..88ae1fc8c 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRVobItem.cs @@ -3,6 +3,7 @@ using GUZ.Core; using GUZ.Core.Globals; using GUZ.Core.Manager; +using GUZ.VR.Manager; using GUZ.VR.Properties; using HurricaneVR.Framework.Core; using HurricaneVR.Framework.Core.Grabbers; @@ -65,10 +66,7 @@ public void OnGrabbed(HVRGrabberBase grabber, HVRGrabbable grabbable) } GameGlobals.VobMeshCulling?.StartTrackVobPositionUpdates(gameObject); - - _properties.CurrentGrabStatus |= grabber.GetComponentInParent().IsLeftHand - ? VRVobItemProperties.GrabStatus.LeftHand - : VRVobItemProperties.GrabStatus.RightHand; + VRPlayerManager.SetGrab(grabber, grabbable); } public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) @@ -81,11 +79,7 @@ public void OnReleased(HVRGrabberBase grabber, HVRGrabbable grabbable) DynamicMaterialManager.ResetDynamicValue(gameObject, Constants.ShaderPropertyTransparency, Constants.ShaderPropertyTransparencyDefault); GameGlobals.VobMeshCulling?.StartTrackVobPositionUpdates(gameObject); - - // Remove flag of hand which released only. - _properties.CurrentGrabStatus &= grabber.GetComponentInParent().IsLeftHand - ? ~VRVobItemProperties.GrabStatus.LeftHand - : ~VRVobItemProperties.GrabStatus.RightHand; + VRPlayerManager.UnsetGrab(grabber, grabbable); } /// diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index 591c1b4f8..8e2412121 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -1,3 +1,4 @@ +using GUZ.VR.Manager; using GUZ.VR.Properties.VobItem; using UnityEngine; @@ -6,17 +7,33 @@ namespace GUZ.VR.Components.VobItem public class VRLockPickInteraction : MonoBehaviour { [SerializeField] private VRVobLockPickProperties _properties; + + private bool _firstFrameHandlingStarted; + private GameObject _handGrabber; + private Quaternion _initialRotation; private void Update() { if (!_properties.IsInsideLock) { + _firstFrameHandlingStarted = false; return; } - + if (!_firstFrameHandlingStarted) + { + StartTracking(); + _firstFrameHandlingStarted = true; + } + + CalculateRotation(); } - + + private void StartTracking() + { + _initialRotation = VRPlayerManager.GrabbedItemLeft.transform.rotation; + } + private void CalculateRotation() { /** @@ -24,6 +41,12 @@ private void CalculateRotation() * 1.a If rotation is ~45° right - trigger right-information to currently active door * 1.b ~45° left - same */ + + var rotation = VRPlayerManager.GrabbedItemLeft.transform.rotation; + var _rotationAxis = Vector3.forward; + var currentRotation = Vector3.Angle(_initialRotation.eulerAngles, rotation * _rotationAxis); + + Debug.Log("rotation: " + currentRotation); } } } diff --git a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs index 28b89d0a0..ee4796fb6 100644 --- a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs +++ b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs @@ -1,10 +1,41 @@ -namespace GUZ.VR.Manager +using HurricaneVR.Framework.Core; +using HurricaneVR.Framework.Core.Grabbers; +using UnityEngine; + +namespace GUZ.VR.Manager { /// /// Contains global states about Hurricane VR player. /// public static class VRPlayerManager { + public static GameObject GrabbedItemLeft; + public static GameObject GrabbedObjectRight; + public static bool DualGrabbedObject => GrabbedItemLeft != null && GrabbedItemLeft == GrabbedObjectRight; + + public static void SetGrab(HVRGrabberBase grabber, HVRGrabbable grabbable) + { + if (grabbable.LeftHandGrabber) + { + GrabbedItemLeft = grabbable.gameObject; + } + else + { + GrabbedObjectRight = grabbable.gameObject; + } + } + + public static void UnsetGrab(HVRGrabberBase grabber, HVRGrabbable grabbable) + { + if (grabbable.LeftHandGrabber) + { + GrabbedItemLeft = null; + } + else + { + GrabbedObjectRight = null; + } + } } } diff --git a/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs index 86e60da6b..f180aad17 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VRVobItemProperties.cs @@ -1,19 +1,9 @@ -using System; -using GUZ.Core.Properties; +using GUZ.Core.Properties; namespace GUZ.VR.Properties { public class VRVobItemProperties : VobItemProperties { public bool IsSocketed; - public GrabStatus CurrentGrabStatus = GrabStatus.None; - - [Flags] - public enum GrabStatus - { - None, - LeftHand, - RightHand - } } } From 533b1fdbd4a7c75aedf207bdf6727d71497c9dd8 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sat, 14 Sep 2024 22:40:21 +0200 Subject: [PATCH 11/25] fix(VRPlayerManager): Added missing pragma --- Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs index ee4796fb6..f80a94ee8 100644 --- a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs +++ b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs @@ -1,4 +1,5 @@ -using HurricaneVR.Framework.Core; +#if GUZ_HVR_INSTALLED +using HurricaneVR.Framework.Core; using HurricaneVR.Framework.Core.Grabbers; using UnityEngine; @@ -39,3 +40,4 @@ public static void UnsetGrab(HVRGrabberBase grabber, HVRGrabbable grabbable) } } } +#endif From 01dfc6f2ce2a43e6024105de02ac7f833ba6e348 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sun, 15 Sep 2024 00:07:25 +0200 Subject: [PATCH 12/25] update(VRDoorLockInteraction): Exchange information about hand rotation with a lock pick and play sounds if correct/incorrect. Also check where player is in L+R combination right now. Bug: Broken sound not playable as of now. --- .../Scripts/Globals/Constants.cs | 10 ++- .../VobDoor/VRDoorLockInteraction.cs | 74 ++++++++++++++++++- .../VobItem/VRLockPickInteraction.cs | 69 +++++++++++++---- .../VobItem/VRVobLockPickProperties.cs | 5 +- 4 files changed, 137 insertions(+), 21 deletions(-) diff --git a/Assets/UnZENity-Core/Scripts/Globals/Constants.cs b/Assets/UnZENity-Core/Scripts/Globals/Constants.cs index 57608e517..79e1f9017 100644 --- a/Assets/UnZENity-Core/Scripts/Globals/Constants.cs +++ b/Assets/UnZENity-Core/Scripts/Globals/Constants.cs @@ -13,9 +13,13 @@ public static class GothicIni public static class Daedalus { - public static string PicklockSuccessSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_SUCCESS").GetString(0); - public static string PicklockFailureSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_FAILURE").GetString(0); - public static string PicklockBrokenSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_BROKEN").GetString(0); + public static string DoorLockSoundName => "DOOR_LOCK.WAV"; + public static string PickLockFailureSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_FAILURE").GetString(0); + public static string PickLockBrokenSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_BROKEN").GetString(0); + public static string PickLockSuccessSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_SUCCESS").GetString(0); + public static string PickLockUnlockSoundName => GameData.GothicVm.GetSymbolByName("_STR_SOUND_PICKLOCK_UNLOCK").GetString(0); + public static string DoorUnlockSoundName => "DOOR_UNLOCK.WAV"; // _STR_*_UNLOCK value above couldn't be found/isn't used in G1, therefore we use this as fallback. + } public static readonly Material LoadingMaterial; // Used for Vobs and World before applying TextureArray. diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index 20aab2c63..dbe648304 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -13,6 +13,16 @@ public class VRDoorLockInteraction : MonoBehaviour [SerializeField] private AudioSource _audioSource; private const string _lockInteractionColliderName = "LockPickInteraction"; + + private string _combination = "LLRRL"; + private int _combinationPos = 0; + + public enum DoorLockStatus + { + StepSuccess, + StepFailure, + DoorUnlocked + } private void OnTriggerEnter(Collider other) { @@ -21,9 +31,12 @@ private void OnTriggerEnter(Collider other) return; } - _audioSource.PlayOneShot(SoundCreator.ToAudioClip(ResourceLoader.TryGetSound(Constants.Daedalus.PicklockFailureSoundName))); + PlaySound(Constants.Daedalus.DoorLockSoundName); - other.gameObject.GetComponentInParent().IsInsideLock = true; + var lockPickProperties = other.gameObject.GetComponentInParent(); + lockPickProperties.IsInsideLock = true; + lockPickProperties.ActiveDoorLock = this; + _combinationPos = 0; } private void OnTriggerExit(Collider other) @@ -33,9 +46,62 @@ private void OnTriggerExit(Collider other) return; } - _audioSource.PlayOneShot(SoundCreator.ToAudioClip(ResourceLoader.TryGetSound(Constants.Daedalus.PicklockFailureSoundName))); + PlaySound(Constants.Daedalus.DoorLockSoundName); + + var lockPickProperties = other.gameObject.GetComponentInParent(); + lockPickProperties.IsInsideLock = false; + lockPickProperties.ActiveDoorLock = null; + } + + public DoorLockStatus UpdateCombination(bool isLeft) + { + var currentChar = _combination[_combinationPos]; + var isCorrect = (isLeft && currentChar == 'L') || (!isLeft && currentChar == 'R'); + + Debug.Log($"IsCorrect={isCorrect}, CombinationChar={currentChar}"); - other.gameObject.GetComponentInParent().IsInsideLock = false; + if (isCorrect) + { + _combinationPos++; + + if (_combinationPos == _combination.Length) + { + // FIXME - Handle "DoorUnlocked" (activate rotation of door). + PlaySound(Constants.Daedalus.PickLockUnlockSoundName, Constants.Daedalus.DoorUnlockSoundName); + return DoorLockStatus.DoorUnlocked; + } + + PlaySound(Constants.Daedalus.PickLockSuccessSoundName); + return DoorLockStatus.StepSuccess; + } + else + { + // TODO - Pseudo breaking for testings only + if (Random.value > 0.5f) + { + PlaySound(Constants.Daedalus.PickLockFailureSoundName); + } + else + { + PlaySound(Constants.Daedalus.PickLockBrokenSoundName); + } + + _combinationPos = 0; + return DoorLockStatus.StepFailure; + } + } + + private void PlaySound(string soundName, string fallback = null) + { + var sound = ResourceLoader.TryGetSound(soundName); + + if (sound == null && fallback != null) + { + PlaySound(fallback); + return; + } + + _audioSource.PlayOneShot(SoundCreator.ToAudioClip(sound)); } } } diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index 8e2412121..dd6697400 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -8,22 +8,37 @@ public class VRLockPickInteraction : MonoBehaviour { [SerializeField] private VRVobLockPickProperties _properties; - private bool _firstFrameHandlingStarted; + private bool _firstFrameHandlingStarted = true; private GameObject _handGrabber; - private Quaternion _initialRotation; + private float _initialZRotation; + + /// + /// A hand rotation with lock pick always need to go: + /// a.) Normal -> Right -> Normal + /// b) Normal -> Left -> Normal + /// (We need to ensure that e.g. a left-left-right combination needs to be recognized properly.) + /// + private RotationState _handRotationState; + + private enum RotationState + { + Normal, + Left, + Right + } private void Update() { if (!_properties.IsInsideLock) { - _firstFrameHandlingStarted = false; + _firstFrameHandlingStarted = true; return; } - if (!_firstFrameHandlingStarted) + if (_firstFrameHandlingStarted) { StartTracking(); - _firstFrameHandlingStarted = true; + _firstFrameHandlingStarted = false; } CalculateRotation(); @@ -31,9 +46,9 @@ private void Update() private void StartTracking() { - _initialRotation = VRPlayerManager.GrabbedItemLeft.transform.rotation; + _initialZRotation = VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z; } - + private void CalculateRotation() { /** @@ -41,12 +56,40 @@ private void CalculateRotation() * 1.a If rotation is ~45° right - trigger right-information to currently active door * 1.b ~45° left - same */ - - var rotation = VRPlayerManager.GrabbedItemLeft.transform.rotation; - var _rotationAxis = Vector3.forward; - var currentRotation = Vector3.Angle(_initialRotation.eulerAngles, rotation * _rotationAxis); - - Debug.Log("rotation: " + currentRotation); + + var rotationDiff = Mathf.DeltaAngle(_initialZRotation, + VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z); + + // Check for specific rotation thresholds + switch (_handRotationState) + { + case RotationState.Normal: + if (rotationDiff >= 45f) + { + _handRotationState = RotationState.Right; + // Trigger right-information to currently active door + _properties.ActiveDoorLock.UpdateCombination(false); + } + else if (rotationDiff <= -45f) + { + _handRotationState = RotationState.Left; + // Trigger left-information to currently active door + _properties.ActiveDoorLock.UpdateCombination(true); + } + break; + case RotationState.Left: + if (rotationDiff > -10) + { + _handRotationState = RotationState.Normal; + } + break; + case RotationState.Right: + if (rotationDiff < 10f) + { + _handRotationState = RotationState.Normal; + } + break; + } } } } diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs index 3e419eb6e..fff3c03c3 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs @@ -1,7 +1,10 @@ -namespace GUZ.VR.Properties.VobItem +using GUZ.VR.Components.VobDoor; + +namespace GUZ.VR.Properties.VobItem { public class VRVobLockPickProperties : VRVobItemProperties { public bool IsInsideLock; + public VRDoorLockInteraction ActiveDoorLock; } } From caa8f22947e1eb30bb8881e37b45ab48e239fd85 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:36:44 +0200 Subject: [PATCH 13/25] fix(VRDoorLockInteraction): Load clip via new API. --- .../Scripts/Components/VobDoor/VRDoorLockInteraction.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index dbe648304..224a841dd 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -3,7 +3,6 @@ using GUZ.Core.Properties; using GUZ.VR.Properties.VobItem; using UnityEngine; -using ResourceLoader = GUZ.Core.ResourceLoader; namespace GUZ.VR.Components.VobDoor { @@ -93,15 +92,15 @@ public DoorLockStatus UpdateCombination(bool isLeft) private void PlaySound(string soundName, string fallback = null) { - var sound = ResourceLoader.TryGetSound(soundName); - - if (sound == null && fallback != null) + var clip = SoundCreator.ToAudioClip(soundName); + + if (clip == null && fallback != null) { PlaySound(fallback); return; } - _audioSource.PlayOneShot(SoundCreator.ToAudioClip(sound)); + _audioSource.PlayOneShot(clip); } } } From 6275ac62029cdcb3d4c07167208c2a2e086f1945 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 06:52:12 +0200 Subject: [PATCH 14/25] fix(LabBootstrapper): Added logger to start and log initialization already. --- Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs index 010f4c0b4..d9f5fb526 100644 --- a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs +++ b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs @@ -10,6 +10,7 @@ using GUZ.Lab.Handler; using UnityEngine; using UnityEngine.SceneManagement; +using Logger = ZenKit.Logger; namespace GUZ.Lab { @@ -57,6 +58,9 @@ private void Awake() { GameGlobals.Instance = this; + Logger.Set(Config.ZenKitLogLevel, Logging.OnZenKitLogMessage); + DirectMusic.Logger.Set(Config.DirectMusicLogLevel, Logging.OnDirectMusicLogMessage); + _settings = GameSettings.Load(); _textureManager = GetComponent(); _fontManager = GetComponent(); From c9584a92523b3576508257b295fb12c1b5cd0b00 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 06:54:44 +0200 Subject: [PATCH 15/25] fix(LabBootstrapper): Added logger to start and log initialization already. --- Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs index d9f5fb526..dd5b89c5f 100644 --- a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs +++ b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs @@ -5,6 +5,7 @@ using GUZ.Core.Manager; using GUZ.Core.Manager.Culling; using GUZ.Core.Manager.Settings; +using GUZ.Core.Util; using GUZ.Core.Vm; using GUZ.Core.World; using GUZ.Lab.Handler; From e050581b65cc88c49777ffb991688280ae736a42 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 09:06:41 +0200 Subject: [PATCH 16/25] fix(VRPlayerController): Missing base.Start() call added. --- Assets/UnZENity-VR/Scripts/Components/VRPlayerController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VRPlayerController.cs b/Assets/UnZENity-VR/Scripts/Components/VRPlayerController.cs index a8026966c..9eb5f26e3 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VRPlayerController.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VRPlayerController.cs @@ -17,8 +17,10 @@ public class VRPlayerController : HVRPlayerController [SerializeField] public GameObject MainMenu; - private void Start() + protected override void Start() { + base.Start(); + GlobalEventDispatcher.PlayerPrefUpdated.AddListener(OnPlayerPrefsUpdated); } From 780008732af14be276ef19dc691a0ae19ff340fa Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:55:10 +0200 Subject: [PATCH 17/25] update(VRDoorLockInteraction): Blocking door from movement if locked and re-enable rotation once unlocked. --- .../Scripts/Creator/Sounds/SoundCreator.cs | 20 ++++---- Assets/UnZENity-Lab/Scenes/Lab.unity | 4 +- .../Scripts/Handler/AbstractLabHandler.cs | 6 +-- .../Scripts/Handler/LabLockHandler.cs | 14 +++++- .../VR/Prefabs/Vobs/oCMobDoor.prefab | 9 +--- .../VobDoor/VRDoorLockInteraction.cs | 23 ++++++++-- .../VobItem/VRLockPickInteraction.cs | 46 +++++++++++++------ 7 files changed, 81 insertions(+), 41 deletions(-) diff --git a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs index ca2027ddb..8ef1360b7 100644 --- a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs +++ b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs @@ -2,6 +2,7 @@ using System.IO; using GUZ.Core.Caches; using GUZ.Core.Data; +using JetBrains.Annotations; using UnityEngine; namespace GUZ.Core.Creator.Sounds @@ -18,6 +19,7 @@ private enum BitDepth /// Create AudioClip from a file inside .vdf containers. /// Usage: ToAudioClip("fileName"): /// + [CanBeNull] public static AudioClip ToAudioClip(string fileName) { fileName = Path.GetFileNameWithoutExtension(fileName); @@ -27,21 +29,15 @@ public static AudioClip ToAudioClip(string fileName) return cachedClip; } - SoundData soundData = ResourceLoader.TryGetSound(fileName); - AudioClip audioClip; - - try - { - audioClip = AudioClip.Create(fileName, soundData.Sound.Length / soundData.Channels, soundData.Channels, soundData.SampleRate, false); - audioClip.SetData(soundData.Sound, 0); - } - catch (Exception e) + var soundData = ResourceLoader.TryGetSound(fileName); + if (soundData == null) { - Debug.LogError(e); - audioClip = AudioClip.Create(fileName, 1, 1, 44100, false); - audioClip.SetData(new float[] { 0 }, 0); // almost empty audio + return null; } + var audioClip = AudioClip.Create(fileName, soundData.Sound.Length / soundData.Channels, soundData.Channels, soundData.SampleRate, false); + audioClip.SetData(soundData.Sound, 0); + MultiTypeCache.AudioClips.Add(fileName, audioClip); return audioClip; } diff --git a/Assets/UnZENity-Lab/Scenes/Lab.unity b/Assets/UnZENity-Lab/Scenes/Lab.unity index 33933bb75..ec0a9a07b 100644 --- a/Assets/UnZENity-Lab/Scenes/Lab.unity +++ b/Assets/UnZENity-Lab/Scenes/Lab.unity @@ -7379,7 +7379,9 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} propertyPath: m_text - value: Locked door demo + value: 'Locked door demo + + (Combination is: LLRRL)' objectReference: {fileID: 0} - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} propertyPath: m_fontSize diff --git a/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs index f9c4e1a9e..eb5a33b87 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/AbstractLabHandler.cs @@ -11,7 +11,7 @@ public abstract class AbstractLabHandler : MonoBehaviour public abstract void Bootstrap(); - protected void SpawnInteractable(string mdlName, PrefabType type, GameObject parentGo, Vector3 position = default, Quaternion rotation = default) + protected GameObject SpawnInteractable(string mdlName, PrefabType type, GameObject parentGo, Vector3 position = default, Quaternion rotation = default) { var prefab = ResourceLoader.TryGetPrefabObject(type); var mdl = ResourceLoader.TryGetModel(mdlName); @@ -19,10 +19,10 @@ protected void SpawnInteractable(string mdlName, PrefabType type, GameObject par if (mdl == null) { Debug.LogError("LabInteractableHandler: Element has no .mdl file: " + mdlName); - return; + return null; } - MeshFactory.CreateVob(mdlName, mdl, position, rotation, + return MeshFactory.CreateVob(mdlName, mdl, position, rotation, rootGo: prefab, parent: parentGo, useTextureArray: false); } diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs index 9f86c5344..ea1d85733 100644 --- a/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabLockHandler.cs @@ -1,4 +1,5 @@ -using GUZ.Core; +using System.Collections; +using GUZ.Core; using UnityEngine; namespace GUZ.Lab.Handler @@ -13,6 +14,17 @@ public override void Bootstrap() { SpawnInteractable("DOOR_WOODEN", PrefabType.VobDoor, _doorSlot); SpawnItem("ItKeLockpick", _lockPickSlot, new(0, -0.5f, 0), PrefabType.VobItemLockPick); + + StartCoroutine(ExecAfter1Frame()); + } + + private IEnumerator ExecAfter1Frame() + { + // We need to wait 1 frame for HVR to create additional Components + yield return null; + + // Lock the door (no rotation) + _doorSlot.GetComponentInChildren().axis = Vector3.zero; } } } diff --git a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab index 20f15db7f..c0484b0b4 100644 --- a/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab +++ b/Assets/UnZENity-VR/Resources/VR/Prefabs/Vobs/oCMobDoor.prefab @@ -231,12 +231,6 @@ MonoBehaviour: UnSocketed: m_PersistentCalls: m_Calls: [] - DistanceGrabbed: - m_PersistentCalls: - m_Calls: [] - DistanceReleased: - m_PersistentCalls: - m_Calls: [] GrabPointsMeta: [] Grabbers: [] HandGrabbers: [] @@ -503,7 +497,7 @@ Transform: m_GameObject: {fileID: 3397705996622112300} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.25, y: 0.75, z: 0} + m_LocalPosition: {x: -0.5, y: 0.75, z: 0.15} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -521,6 +515,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9d17628e45ec40eda22323a8f4579285, type: 3} m_Name: m_EditorClassIdentifier: + _rootGO: {fileID: 6503575194566409312} _properties: {fileID: 2607151182155886275} _audioSource: {fileID: 4670513280573296585} --- !u!135 &827370569709809547 diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index 224a841dd..c9912a178 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -8,11 +8,13 @@ namespace GUZ.VR.Components.VobDoor { public class VRDoorLockInteraction : MonoBehaviour { + [SerializeField] private GameObject _rootGO; [SerializeField] private VobDoorProperties _properties; [SerializeField] private AudioSource _audioSource; - + private const string _lockInteractionColliderName = "LockPickInteraction"; + // FIXME - Move into IDoor lab instance once provided by ZenKit. private string _combination = "LLRRL"; private int _combinationPos = 0; @@ -20,7 +22,7 @@ public enum DoorLockStatus { StepSuccess, StepFailure, - DoorUnlocked + Unlocked } private void OnTriggerEnter(Collider other) @@ -30,6 +32,13 @@ private void OnTriggerEnter(Collider other) return; } + // FIXME - For lab only. Remove once Interface of Door (IDoor) exists: https://github.com/GothicKit/ZenKitCS/pull/12 + // Mark all doors as locked in lab + if (_properties.DoorProperties != null && !_properties.DoorProperties.IsLocked) + { + return; + } + PlaySound(Constants.Daedalus.DoorLockSoundName); var lockPickProperties = other.gameObject.GetComponentInParent(); @@ -65,9 +74,15 @@ public DoorLockStatus UpdateCombination(bool isLeft) if (_combinationPos == _combination.Length) { - // FIXME - Handle "DoorUnlocked" (activate rotation of door). + // FIXME - Set door properties once IDoor interface is used with Lab implementation. + // _properties.DoorProperties.IsLocked = false; + + // Reactivate rotation + _rootGO.GetComponentInChildren().axis = Vector3.up; + PlaySound(Constants.Daedalus.PickLockUnlockSoundName, Constants.Daedalus.DoorUnlockSoundName); - return DoorLockStatus.DoorUnlocked; + + return DoorLockStatus.Unlocked; } PlaySound(Constants.Daedalus.PickLockSuccessSoundName); diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index dd6697400..fc2c96dac 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -1,3 +1,4 @@ +using GUZ.VR.Components.VobDoor; using GUZ.VR.Manager; using GUZ.VR.Properties.VobItem; using UnityEngine; @@ -43,20 +44,21 @@ private void Update() CalculateRotation(); } - + + /// + /// Set start rotation of hand(s) which grab item. (As we have 2 hands, we need to check via array[2] for both items always! + /// private void StartTracking() { _initialZRotation = VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z; } + /// + /// 1. If rotation is ~45° right/left - trigger information to currently active door + /// 2. Once we're in a left/right state, rotate back to ~10° where the status gets cleared and a new left/right can be triggered + /// private void CalculateRotation() { - /** - * 0. Set start rotation of hand(s) which grab item. (As we have 2 hands, we need to check via array[2] for both items always! - * 1.a If rotation is ~45° right - trigger right-information to currently active door - * 1.b ~45° left - same - */ - var rotationDiff = Mathf.DeltaAngle(_initialZRotation, VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z); @@ -66,15 +68,11 @@ private void CalculateRotation() case RotationState.Normal: if (rotationDiff >= 45f) { - _handRotationState = RotationState.Right; - // Trigger right-information to currently active door - _properties.ActiveDoorLock.UpdateCombination(false); + UpdateStatus(RotationState.Right); } else if (rotationDiff <= -45f) { - _handRotationState = RotationState.Left; - // Trigger left-information to currently active door - _properties.ActiveDoorLock.UpdateCombination(true); + UpdateStatus(RotationState.Left); } break; case RotationState.Left: @@ -91,5 +89,27 @@ private void CalculateRotation() break; } } + + private void UpdateStatus(RotationState state) + { + _handRotationState = state; + + // Trigger right/left information to currently active door + var doorState = _properties.ActiveDoorLock.UpdateCombination(_handRotationState == RotationState.Left); + + switch (doorState) + { + case VRDoorLockInteraction.DoorLockStatus.StepFailure: + // FIXME - Handle break of a Lock Pick based on heros skill level + break; + case VRDoorLockInteraction.DoorLockStatus.StepSuccess: + break; + case VRDoorLockInteraction.DoorLockStatus.Unlocked: + // We immediately reset current door as it's unlocked, and we don't need to use lock pick any longer. + _properties.IsInsideLock = false; + _properties.ActiveDoorLock = null; + break; + } + } } } From 166f2f66f64336f344e45e5b35effc3862410b98 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:03:59 +0200 Subject: [PATCH 18/25] fix(#pragma): --- .../Scripts/Components/VobDoor/VRDoorLockInteraction.cs | 5 ++++- .../Scripts/Components/VobItem/VRLockPickInteraction.cs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index c9912a178..e7fcc55d4 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -1,4 +1,5 @@ -using GUZ.Core.Creator.Sounds; +#if GUZ_HVR_INSTALLED +using GUZ.Core.Creator.Sounds; using GUZ.Core.Globals; using GUZ.Core.Properties; using GUZ.VR.Properties.VobItem; @@ -119,3 +120,5 @@ private void PlaySound(string soundName, string fallback = null) } } } +#endif + diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index fc2c96dac..c27085957 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -1,3 +1,4 @@ +#if GUZ_HVR_INSTALLED using GUZ.VR.Components.VobDoor; using GUZ.VR.Manager; using GUZ.VR.Properties.VobItem; @@ -113,3 +114,4 @@ private void UpdateStatus(RotationState state) } } } +#endif From a324998234cb69a96bbdca10f5cf2c52e8f09b2b Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:41:56 +0200 Subject: [PATCH 19/25] fix(VRLockPickInteraction): Add Left and Right hand usage. --- .../Lab.HVR.Simulator.asset | 3 ++- .../VobDoor/VRDoorLockInteraction.cs | 20 +++++++++++++++++-- .../VobItem/VRLockPickInteraction.cs | 7 +++---- .../Scripts/Manager/VRPlayerManager.cs | 10 ++++++++-- .../VobItem/VRVobLockPickProperties.cs | 2 ++ 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Assets/UnZENity-Core/Resources/GameConfigurations/Lab.HVR.Simulator.asset b/Assets/UnZENity-Core/Resources/GameConfigurations/Lab.HVR.Simulator.asset index 969bfd7c0..d0e2b9593 100644 --- a/Assets/UnZENity-Core/Resources/GameConfigurations/Lab.HVR.Simulator.asset +++ b/Assets/UnZENity-Core/Resources/GameConfigurations/Lab.HVR.Simulator.asset @@ -34,9 +34,10 @@ MonoBehaviour: LargeVOBMeshCullingGroup: MaximumObjectSize: 100 CullingDistance: 200 - ShowVOBMeshCullingGizmos: 0 BrightenUpHoveredVOBs: 1 ShowNamesOnHoveredVOBs: 1 + ShowVOBMeshCullingGizmos: 0 + ShowCapsuleOverlapGizmos: 0 EnableNpcs: 0 EnableNpcMeshCulling: 1 NpcCullingDistance: 50 diff --git a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs index e7fcc55d4..279c85c95 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobDoor/VRDoorLockInteraction.cs @@ -2,6 +2,8 @@ using GUZ.Core.Creator.Sounds; using GUZ.Core.Globals; using GUZ.Core.Properties; +using GUZ.VR.Components.VobItem; +using GUZ.VR.Manager; using GUZ.VR.Properties.VobItem; using UnityEngine; @@ -40,12 +42,25 @@ private void OnTriggerEnter(Collider other) return; } + _combinationPos = 0; PlaySound(Constants.Daedalus.DoorLockSoundName); - + var lockPickProperties = other.gameObject.GetComponentInParent(); lockPickProperties.IsInsideLock = true; lockPickProperties.ActiveDoorLock = this; - _combinationPos = 0; + + if (VRPlayerManager.GrabbedItemLeft?.GetComponentInChildren().gameObject == other.gameObject) + { + lockPickProperties.HoldingHand = VRPlayerManager.GrabbedItemLeft!.transform; + } + else if (VRPlayerManager.GrabbedObjectRight?.GetComponentInChildren().gameObject == other.gameObject) + { + lockPickProperties.HoldingHand = VRPlayerManager.GrabbedObjectRight!.transform; + } + else + { + Debug.LogError($"VRDoorLockInteraction: No hand found for grabbed object >{other.gameObject.name}<.", other.gameObject); + } } private void OnTriggerExit(Collider other) @@ -60,6 +75,7 @@ private void OnTriggerExit(Collider other) var lockPickProperties = other.gameObject.GetComponentInParent(); lockPickProperties.IsInsideLock = false; lockPickProperties.ActiveDoorLock = null; + lockPickProperties.HoldingHand = null; } public DoorLockStatus UpdateCombination(bool isLeft) diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index c27085957..baa752458 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -1,6 +1,5 @@ #if GUZ_HVR_INSTALLED using GUZ.VR.Components.VobDoor; -using GUZ.VR.Manager; using GUZ.VR.Properties.VobItem; using UnityEngine; @@ -11,7 +10,6 @@ public class VRLockPickInteraction : MonoBehaviour [SerializeField] private VRVobLockPickProperties _properties; private bool _firstFrameHandlingStarted = true; - private GameObject _handGrabber; private float _initialZRotation; /// @@ -51,7 +49,7 @@ private void Update() /// private void StartTracking() { - _initialZRotation = VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z; + _initialZRotation = _properties.HoldingHand.rotation.eulerAngles.z; } /// @@ -61,7 +59,7 @@ private void StartTracking() private void CalculateRotation() { var rotationDiff = Mathf.DeltaAngle(_initialZRotation, - VRPlayerManager.GrabbedItemLeft.transform.rotation.eulerAngles.z); + _properties.HoldingHand.transform.rotation.eulerAngles.z); // Check for specific rotation thresholds switch (_handRotationState) @@ -109,6 +107,7 @@ private void UpdateStatus(RotationState state) // We immediately reset current door as it's unlocked, and we don't need to use lock pick any longer. _properties.IsInsideLock = false; _properties.ActiveDoorLock = null; + _properties.HoldingHand = null; break; } } diff --git a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs index f80a94ee8..b32da79c6 100644 --- a/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs +++ b/Assets/UnZENity-VR/Scripts/Manager/VRPlayerManager.cs @@ -12,8 +12,14 @@ public static class VRPlayerManager { public static GameObject GrabbedItemLeft; public static GameObject GrabbedObjectRight; - - public static bool DualGrabbedObject => GrabbedItemLeft != null && GrabbedItemLeft == GrabbedObjectRight; + + public enum HandType + { + Left, + Right + } + + public static bool IsDualGrabbed => GrabbedItemLeft != null && GrabbedItemLeft == GrabbedObjectRight; public static void SetGrab(HVRGrabberBase grabber, HVRGrabbable grabbable) { diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs index fff3c03c3..1e7bbd154 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs @@ -1,4 +1,5 @@ using GUZ.VR.Components.VobDoor; +using UnityEngine; namespace GUZ.VR.Properties.VobItem { @@ -6,5 +7,6 @@ public class VRVobLockPickProperties : VRVobItemProperties { public bool IsInsideLock; public VRDoorLockInteraction ActiveDoorLock; + public Transform HoldingHand; } } From d8079d28a2b65a4bf2675cf7e37d2e809997c559 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 12:46:25 +0200 Subject: [PATCH 20/25] fix(#pragma): --- .../Scripts/Properties/VobItem/VRVobLockPickProperties.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs index 1e7bbd154..1439d338f 100644 --- a/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs +++ b/Assets/UnZENity-VR/Scripts/Properties/VobItem/VRVobLockPickProperties.cs @@ -1,4 +1,5 @@ -using GUZ.VR.Components.VobDoor; +#if GUZ_HVR_INSTALLED +using GUZ.VR.Components.VobDoor; using UnityEngine; namespace GUZ.VR.Properties.VobItem @@ -10,3 +11,4 @@ public class VRVobLockPickProperties : VRVobItemProperties public Transform HoldingHand; } } +#endif From f88a81781680ffb5065e7d5a7f18f13baa9d1c96 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:07:01 +0200 Subject: [PATCH 21/25] fix(#pragma): --- .../Scripts/Components/VobItem/VRLockPickInteraction.cs | 6 ++++-- Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs index baa752458..a503920d6 100644 --- a/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs +++ b/Assets/UnZENity-VR/Scripts/Components/VobItem/VRLockPickInteraction.cs @@ -58,8 +58,10 @@ private void StartTracking() /// private void CalculateRotation() { + Debug.Log($"InitialRotZ={_initialZRotation}, CurrentRotZ={_properties.HoldingHand.rotation.eulerAngles.z}"); + var rotationDiff = Mathf.DeltaAngle(_initialZRotation, - _properties.HoldingHand.transform.rotation.eulerAngles.z); + _properties.HoldingHand.rotation.eulerAngles.z); // Check for specific rotation thresholds switch (_handRotationState) @@ -99,7 +101,7 @@ private void UpdateStatus(RotationState state) switch (doorState) { case VRDoorLockInteraction.DoorLockStatus.StepFailure: - // FIXME - Handle break of a Lock Pick based on heros skill level + // FIXME - Handle break of a Lock Pick based on hero's skill level break; case VRDoorLockInteraction.DoorLockStatus.StepSuccess: break; diff --git a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs index ddebc1e31..35b177904 100644 --- a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs +++ b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs @@ -1,6 +1,7 @@ using GUZ.Core.Context; +#if GUZ_HVR_INSTALLED using GUZ.VR.Adapter; -#if !GUZ_HVR_INSTALLED +#else using System; #endif From 2e5ce9039fdd20b1423d5d1144bee66249c462c5 Mon Sep 17 00:00:00 2001 From: Jucan Andrei Daniel Date: Sun, 29 Sep 2024 13:08:24 +0300 Subject: [PATCH 22/25] add LabSoundHandler to the lab --- Assets/UnZENity-Lab/Scenes/Lab.unity | 1504 ++++++++++++++--- .../Scripts/Handler/LabSoundHandler.cs | 33 + .../Scripts/Handler/LabSoundHandler.cs.meta | 3 + .../UnZENity-Lab/Scripts/LabBootstrapper.cs | 2 + 4 files changed, 1341 insertions(+), 201 deletions(-) create mode 100644 Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs create mode 100644 Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs.meta diff --git a/Assets/UnZENity-Lab/Scenes/Lab.unity b/Assets/UnZENity-Lab/Scenes/Lab.unity index ec0a9a07b..5f6e2b92f 100644 --- a/Assets/UnZENity-Lab/Scenes/Lab.unity +++ b/Assets/UnZENity-Lab/Scenes/Lab.unity @@ -122,6 +122,11 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!224 &4152766 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + m_PrefabInstance: {fileID: 1882075807} + m_PrefabAsset: {fileID: 0} --- !u!1001 &42175755 PrefabInstance: m_ObjectHideFlags: 0 @@ -591,6 +596,142 @@ RectTransform: m_CorrespondingSourceObject: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} m_PrefabInstance: {fileID: 91929453} m_PrefabAsset: {fileID: 0} +--- !u!1 &98241771 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 98241772} + - component: {fileID: 98241774} + - component: {fileID: 98241773} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &98241772 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98241771} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 900316555} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 126, y: 18} + m_Pivot: {x: 0, y: 0.5} +--- !u!114 &98241773 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98241771} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 1. Select sound effect + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: f675742eaf9c20a4f909d78ee7a14fed, type: 2} + m_sharedMaterial: {fileID: 4687939059374929122, guid: f675742eaf9c20a4f909d78ee7a14fed, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4293190884 + m_fontColor: {r: 0.89411765, g: 0.89411765, b: 0.89411765, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &98241774 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98241771} + m_CullTransparentMesh: 0 --- !u!1 &108303441 GameObject: m_ObjectHideFlags: 0 @@ -2409,6 +2550,11 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 +--- !u!224 &420752068 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + m_PrefabInstance: {fileID: 1783351451} + m_PrefabAsset: {fileID: 0} --- !u!1 &428376841 GameObject: m_ObjectHideFlags: 0 @@ -4203,6 +4349,7 @@ Transform: - {fileID: 501618519} - {fileID: 1791413020} - {fileID: 408181897} + - {fileID: 1011376552} - {fileID: 1219449893} - {fileID: 747305792} - {fileID: 330949650} @@ -5154,6 +5301,99 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 841381674} m_CullTransparentMesh: 0 +--- !u!114 &883304690 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + m_PrefabInstance: {fileID: 1261261454} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!224 &883304691 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + m_PrefabInstance: {fileID: 1261261454} + m_PrefabAsset: {fileID: 0} +--- !u!1 &900316554 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 900316555} + - component: {fileID: 900316557} + - component: {fileID: 900316556} + m_Layer: 5 + m_Name: FileSelector + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &900316555 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900316554} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 98241772} + - {fileID: 883304691} + m_Father: {fileID: 1156960607} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 241, y: 492} + m_SizeDelta: {x: 464, y: 60} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &900316556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900316554} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: d862c4d6d47b37348a252ad3f6139791, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &900316557 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 900316554} + m_CullTransparentMesh: 0 --- !u!1 &900567009 GameObject: m_ObjectHideFlags: 0 @@ -6433,41 +6673,184 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 983727577} m_CullTransparentMesh: 0 ---- !u!1001 &1027245749 -PrefabInstance: +--- !u!1 &1011376551 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1011376552} + - component: {fileID: 1011376553} + - component: {fileID: 1011376554} + m_Layer: 0 + m_Name: SoundTool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1011376552 +Transform: m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011376551} serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 113053083} - m_Modifications: - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_RootOrder - value: 13 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_AnchorMax.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_AnchorMax.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_AnchorMin.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} - propertyPath: m_AnchorMin.y - value: 0.5 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 15, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1156960607} + m_Father: {fileID: 648481967} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1011376553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011376551} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ebf8123a35ae4f4eb7805127f19cfe07, type: 3} + m_Name: + m_EditorClassIdentifier: + FileSelector: {fileID: 883304690} +--- !u!82 &1011376554 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1011376551} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!1001 &1027245749 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 113053083} + m_Modifications: + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_RootOrder + value: 13 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} propertyPath: m_SizeDelta.x @@ -7554,117 +7937,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1152037190} m_CullTransparentMesh: 0 ---- !u!1001 &1160407333 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 113053083} - m_Modifications: - - target: {fileID: 5289182684144184604, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_ActiveFontFeatures.Array.data[0] - value: 1801810542 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692540, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_Name - value: Text Button - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_RootOrder - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchorMax.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchorMax.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchorMin.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchorMin.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_SizeDelta.x - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_SizeDelta.y - value: 60 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchoredPosition.x - value: -384 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_AnchoredPosition.y - value: -306.0002 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} ---- !u!224 &1160407334 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} - m_PrefabInstance: {fileID: 1160407333} - m_PrefabAsset: {fileID: 0} ---- !u!1 &1162407905 +--- !u!1 &1156960606 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -7672,9 +7945,283 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1162407906} - m_Layer: 0 - m_Name: DoorSlot + - component: {fileID: 1156960607} + - component: {fileID: 1156960613} + - component: {fileID: 1156960612} + - component: {fileID: 1156960611} + - component: {fileID: 1156960610} + - component: {fileID: 1156960609} + - component: {fileID: 1156960608} + m_Layer: 5 + m_Name: Menu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1156960607 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.0009999999, y: 0.0009999999, z: 0.0009999999} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 420752068} + - {fileID: 900316555} + - {fileID: 4152766} + m_Father: {fileID: 1011376552} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2000, y: 1000} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1156960608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7951c64acb0fa62458bf30a60089fe2d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 0 + m_CheckFor2DOcclusion: 0 + m_CheckFor3DOcclusion: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RaycastTriggerInteraction: 1 +--- !u!114 &1156960609 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: d862c4d6d47b37348a252ad3f6139791, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.7490196} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: b12d44d3217c34c41bc8fa035fa687a4, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 8 +--- !u!222 &1156960610 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_CullTransparentMesh: 1 +--- !u!114 &1156960611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1156960612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &1156960613 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1156960606} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1001 &1160407333 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 113053083} + m_Modifications: + - target: {fileID: 5289182684144184604, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692540, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_Name + value: Text Button + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_SizeDelta.x + value: 200 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_SizeDelta.y + value: 60 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchoredPosition.x + value: -384 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_AnchoredPosition.y + value: -306.0002 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} +--- !u!224 &1160407334 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 5289182684458692541, guid: 523fb0f2bb5e3aa438d6a146807c37e0, type: 3} + m_PrefabInstance: {fileID: 1160407333} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1162407905 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1162407906} + m_Layer: 0 + m_Name: DoorSlot m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -8012,15 +8559,168 @@ CanvasRenderer: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1231981649} - m_CullTransparentMesh: 0 ---- !u!1001 &1257716464 + m_GameObject: {fileID: 1231981649} + m_CullTransparentMesh: 0 +--- !u!1001 &1257716464 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 910817778} + m_Modifications: + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_SizeDelta.x + value: -154 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_SizeDelta.y + value: 60 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalPosition.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchoredPosition.x + value: -250 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480881, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_Name + value: Category + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 330949651} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: CategoryDropdownValueChanged + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: GVR.Lab.Handler.VobHandAttachPointsHandler, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} + - target: {fileID: 6262935102763893786, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_text + value: Option A + objectReference: {fileID: 0} + - target: {fileID: 6262935102763893786, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} +--- !u!224 &1257716465 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + m_PrefabInstance: {fileID: 1257716464} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1257716466 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} + m_PrefabInstance: {fileID: 1257716464} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1001 &1261261454 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: serializedVersion: 3 - m_TransformParent: {fileID: 910817778} + m_TransformParent: {fileID: 900316555} m_Modifications: - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_Pivot.x @@ -8068,7 +8768,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_LocalPosition.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_LocalRotation.w @@ -8076,19 +8776,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_AnchoredPosition.x - value: -250 + value: 77 objectReference: {fileID: 0} - target: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_AnchoredPosition.y @@ -8108,35 +8808,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 6262935102578480881, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_Name - value: Category - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.size - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Mode - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 330949651} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_CallState - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: CategoryDropdownValueChanged - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName - value: GVR.Lab.Handler.VobHandAttachPointsHandler, Assembly-CSharp - objectReference: {fileID: 0} - - target: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName - value: UnityEngine.Object, UnityEngine + value: File objectReference: {fileID: 0} - target: {fileID: 6262935102763893786, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} propertyPath: m_text @@ -8151,22 +8823,6 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} ---- !u!224 &1257716465 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 6262935102578480880, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - m_PrefabInstance: {fileID: 1257716464} - m_PrefabAsset: {fileID: 0} ---- !u!114 &1257716466 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6262935102578480883, guid: c07ef68f08a1b5a4fb6c4b71ea47b8ba, type: 3} - m_PrefabInstance: {fileID: 1257716464} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1264235285 GameObject: m_ObjectHideFlags: 0 @@ -12073,6 +12729,136 @@ Transform: - {fileID: 113053083} m_Father: {fileID: 1620998804} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!1001 &1783351451 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1156960607} + m_Modifications: + - target: {fileID: 20594597629701500, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Camera + value: + objectReference: {fileID: 0} + - target: {fileID: 228334215268425848, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Name + value: Legibility Mask Text + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_RootOrder + value: 21 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.x + value: 500 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_SizeDelta.y + value: 400 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalPosition.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.x + value: -752 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_AnchoredPosition.y + value: 299 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 893294720952735752, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1664430050543467610, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_Material + value: + objectReference: {fileID: 2100000, guid: d862c4d6d47b37348a252ad3f6139791, type: 2} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_text + value: Sound demo - plays sound effects + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontSize + value: 35 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontStyle + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_fontSizeBase + value: 35 + objectReference: {fileID: 0} + - target: {fileID: 8228542742798409357, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: + - {fileID: 798198255077022564, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 30a1e77eafe8f644dba70315d5f67504, type: 3} --- !u!1 &1791413019 GameObject: m_ObjectHideFlags: 0 @@ -12693,6 +13479,223 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1864588339} m_CullTransparentMesh: 0 +--- !u!1001 &1882075807 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1156960607} + m_Modifications: + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.x + value: 294.1 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.x + value: 642 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.y + value: 490 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262082, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630661673262138, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_Name + value: Load + objectReference: {fileID: 0} + - target: {fileID: 781630662526433601, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630662526433601, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630662526433601, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630662526433601, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630662526433601, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630662526433607, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_text + value: 2. Play + objectReference: {fileID: 0} + - target: {fileID: 781630662526433607, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105844, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_text + value: Play selected music + objectReference: {fileID: 0} + - target: {fileID: 781630663273105844, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.x + value: 150 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.x + value: 147.05 + objectReference: {fileID: 0} + - target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.y + value: -55.895 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 1011376553} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: SoundPlayClick + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: GUZ.Lab.Handler.LabSoundHandler, UnZENity.Lab + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466252, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466255, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466255, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466255, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466255, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3462299961317466255, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3462299961648751150, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_text + value: Play + objectReference: {fileID: 0} + - target: {fileID: 3462299961648751150, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_ActiveFontFeatures.Array.data[0] + value: 1801810542 + objectReference: {fileID: 0} + - target: {fileID: 6960627886175621283, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} + propertyPath: m_BlockingMask.m_Bits + value: 4294967295 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fcac0c3f142ea3742a0565751dec41de, type: 3} --- !u!1001 &1890716238 PrefabInstance: m_ObjectHideFlags: 0 @@ -13658,6 +14661,7 @@ GameObject: - component: {fileID: 2101890270} - component: {fileID: 2101890272} - component: {fileID: 2101890271} + - component: {fileID: 2101890273} m_Layer: 0 m_Name: Bootstrap m_TagString: Untagged @@ -13695,6 +14699,7 @@ MonoBehaviour: m_EditorClassIdentifier: k__BackingField: {fileID: 11400000, guid: d1ee11f3526d3a847a5aaeefc5da6ab2, type: 2} LabMusicHandler: {fileID: 408181898} + LabSoundHandler: {fileID: 1011376553} LabVideoHandler: {fileID: 1219449894} NpcDialogHandler: {fileID: 1791413021} InteractableHandler: {fileID: 1956714045} @@ -13702,6 +14707,7 @@ MonoBehaviour: VobItemHandler: {fileID: 330949651} LabNpcAnimationHandler: {fileID: 501618520} LabLockHandler: {fileID: 640496639} + Validate: 0 --- !u!114 &2101890271 MonoBehaviour: m_ObjectHideFlags: 0 @@ -13746,6 +14752,102 @@ MonoBehaviour: SkyMaterial: {fileID: 2100000, guid: 39ac659c922b5b1489714aacd9b952e9, type: 2} MapMaterial: {fileID: 0} BackgroundMaterial: {fileID: 2100000, guid: 1e349bd46543d684da0fd00dfcc78b72, type: 2} +--- !u!82 &2101890273 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2101890268} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &2122853906 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs b/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs new file mode 100644 index 000000000..323abf0ab --- /dev/null +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs @@ -0,0 +1,33 @@ +using System.Linq; +using GUZ.Core; +using GUZ.Core.Creator.Sounds; +using TMPro; +using UnityEngine; +using UnityEngine.Serialization; + +namespace GUZ.Lab.Handler +{ + public class LabSoundHandler : AbstractLabHandler + { + [FormerlySerializedAs("fileSelector")] public TMP_Dropdown FileSelector; + + + public override void Bootstrap() + { + var vm = ResourceLoader.TryGetDaedalusVm("SFX"); + + var sfxInstances = vm.GetInstanceSymbols("C_SFX") + .Select(s => s.Name) + .ToList(); + + FileSelector.options = sfxInstances.Select(i => new TMP_Dropdown.OptionData(i)).ToList(); + } + + public void SoundPlayClick() + { + GetComponent().clip = SoundCreator.ToAudioClip(FileSelector.options[FileSelector.value].text); + GetComponent().loop = true; + GetComponent().Play(); + } + } +} diff --git a/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs.meta b/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs.meta new file mode 100644 index 000000000..af513d11a --- /dev/null +++ b/Assets/UnZENity-Lab/Scripts/Handler/LabSoundHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ebf8123a35ae4f4eb7805127f19cfe07 +timeCreated: 1726825180 diff --git a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs index dd5b89c5f..ae07af250 100644 --- a/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs +++ b/Assets/UnZENity-Lab/Scripts/LabBootstrapper.cs @@ -22,6 +22,7 @@ public class LabBootstrapper : MonoBehaviour, IGlobalDataProvider, ICoroutineMan public GameConfiguration Config { get; private set; } public LabMusicHandler LabMusicHandler; + public LabSoundHandler LabSoundHandler; public LabVideoHandler LabVideoHandler; public LabNpcDialogHandler NpcDialogHandler; public LabInteractableHandler InteractableHandler; @@ -97,6 +98,7 @@ private void Update() LabNpcAnimationHandler.Bootstrap(); LabMusicHandler.Bootstrap(); + LabSoundHandler.Bootstrap(); LabVideoHandler.Bootstrap(); NpcDialogHandler.Bootstrap(); InteractableHandler.Bootstrap(); From 499f5b4352cbb007f7e5e67afafd1930b7946eb0 Mon Sep 17 00:00:00 2001 From: Jucan Andrei Daniel Date: Sun, 29 Sep 2024 17:12:05 +0300 Subject: [PATCH 23/25] fix(SoundCreator): add PAD subchunk support --- .../Scripts/Creator/Sounds/SoundCreator.cs | 76 +++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs index 8ef1360b7..c7e7747e5 100644 --- a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs +++ b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Text; using GUZ.Core.Caches; using GUZ.Core.Data; using JetBrains.Annotations; @@ -35,7 +36,8 @@ public static AudioClip ToAudioClip(string fileName) return null; } - var audioClip = AudioClip.Create(fileName, soundData.Sound.Length / soundData.Channels, soundData.Channels, soundData.SampleRate, false); + var audioClip = AudioClip.Create(fileName, soundData.Sound.Length / soundData.Channels, soundData.Channels, + soundData.SampleRate, false); audioClip.SetData(soundData.Sound, 0); MultiTypeCache.AudioClips.Add(fileName, audioClip); @@ -44,49 +46,63 @@ public static AudioClip ToAudioClip(string fileName) public static SoundData ConvertWavByteArrayToFloatArray(byte[] fileBytes) { - //var riff = Encoding.ASCII.GetString(fileBytes, 0, 4); - //var wave = Encoding.ASCII.GetString(fileBytes, 8, 4); - var subchunk1 = BitConverter.ToInt32(fileBytes, 16); - var audioFormat = BitConverter.ToUInt16(fileBytes, 20); - - var formatCode = FormatCode(audioFormat); - - var channels = BitConverter.ToUInt16(fileBytes, 22); - var sampleRate = BitConverter.ToInt32(fileBytes, 24); - //var byteRate = BitConverter.ToInt32(fileBytes, 28); - //var blockAlign = BitConverter.ToUInt16(fileBytes, 32); - var bitDepth = BitConverter.ToUInt16(fileBytes, 34); - - // Calculate header offset and data size - var headerOffset = 20 + subchunk1; - var dataSizeOffset = headerOffset + 4; - if (dataSizeOffset + 4 > fileBytes.Length) - { - throw new ArgumentException("Invalid WAV file structure."); - } + string riffHeader = Encoding.ASCII.GetString(fileBytes, 0, 4); + + int fileSize = BitConverter.ToInt32(fileBytes, 4); + + string waveHeader = Encoding.ASCII.GetString(fileBytes, 8, 4); + + string fmtHeader = Encoding.ASCII.GetString(fileBytes, 12, 4); + + int fmtLength = BitConverter.ToInt32(fileBytes, 16); - var subchunk2 = BitConverter.ToInt32(fileBytes, dataSizeOffset); + ushort formatType = BitConverter.ToUInt16(fileBytes, 20); - // Ensure that subchunk2 does not exceed fileBytes length - var dataAvailable = fileBytes.Length - (dataSizeOffset + 4); - if (subchunk2 > dataAvailable) + string formatCode = FormatCode(formatType); + + ushort numChannels = BitConverter.ToUInt16(fileBytes, 22); + + int sampleRate = BitConverter.ToInt32(fileBytes, 24); + + int byteRate = BitConverter.ToInt32(fileBytes, 28); + + short blockAlign = BitConverter.ToInt16(fileBytes, 32); + + short bitsPerSample = BitConverter.ToInt16(fileBytes, 34); + + string dataHeader = Encoding.ASCII.GetString(fileBytes, 36, 4); + + // Check for "PAD" header and skip it if present + int padSize = 0; + while (dataHeader == "PAD ") { - subchunk2 = dataAvailable; + padSize = padSize + BitConverter.ToInt32(fileBytes, 40); + + // we add 8 bits to padding as to skip the pad subchunk header + data + padSize = padSize + 8; + + // Skip the PAD section + dataHeader = Encoding.ASCII.GetString(fileBytes, 36 + padSize, 4); } + int dataSize = BitConverter.ToInt32(fileBytes, 40 + padSize); + if (formatCode == "IMA ADPCM") { return ConvertWavByteArrayToFloatArray(ImaadpcmDecoder.Decode(fileBytes)); } + + // sometimes a file has more data than is specified after the RIFF header + long stopPosition = Math.Min(dataSize, (fileBytes.Length - 44)); // Copy WAV data section into a new array - var data = new byte[subchunk2]; - Array.Copy(fileBytes, dataSizeOffset + 4, data, 0, subchunk2); + var audioData = new byte[stopPosition]; + Array.Copy(fileBytes, 44+padSize, audioData, 0, stopPosition); return new SoundData { - Sound = ConvertByteArrayToFloatArray(data, 0, (BitDepth)bitDepth), - Channels = channels, + Sound = ConvertByteArrayToFloatArray(audioData, 0, (BitDepth)bitsPerSample), + Channels = numChannels, SampleRate = sampleRate }; } From 382cff6133fea4360177b0a2d55dbf26fe88ac26 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:34:43 +0200 Subject: [PATCH 24/25] fix: Comilation without HVR --- Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs index 7db6dee6f..14660f73c 100644 --- a/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs +++ b/Assets/UnZENity-VR/Scripts/VRContextBootstrap.cs @@ -3,7 +3,6 @@ using ZenKit; #if GUZ_HVR_INSTALLED using GUZ.VR.Adapter; -#else #endif namespace GUZ.VR @@ -25,7 +24,7 @@ protected override void RegisterControlModule(GameContext.Controls controls) GameContext.InteractionAdapter = new VRInteractionAdapter(); GameContext.DialogAdapter = new VRDialogAdapter(); #else - throw new ArgumentException( + throw new System.ArgumentException( "VR context is set, but compiler directive >GUZ_HVR_INSTALLED< isn't set. Did you set up Hurricane VR properly?"); #endif } From 52a8baa5612c330160c7c904f84516ee7aac6e99 Mon Sep 17 00:00:00 2001 From: JaXt0r <120568393+JaXt0r@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:38:22 +0200 Subject: [PATCH 25/25] candy: Format of lines and remove of unused WAV elements with comment. --- .../Scripts/Creator/Sounds/SoundCreator.cs | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs index c7e7747e5..d64268025 100644 --- a/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs +++ b/Assets/UnZENity-Core/Scripts/Creator/Sounds/SoundCreator.cs @@ -46,40 +46,33 @@ public static AudioClip ToAudioClip(string fileName) public static SoundData ConvertWavByteArrayToFloatArray(byte[] fileBytes) { - string riffHeader = Encoding.ASCII.GetString(fileBytes, 0, 4); + // HINT: Commented out elements are there for reference only. - int fileSize = BitConverter.ToInt32(fileBytes, 4); - - string waveHeader = Encoding.ASCII.GetString(fileBytes, 8, 4); - - string fmtHeader = Encoding.ASCII.GetString(fileBytes, 12, 4); - - int fmtLength = BitConverter.ToInt32(fileBytes, 16); + // string riffHeader = Encoding.ASCII.GetString(fileBytes, 0, 4); + // int fileSize = BitConverter.ToInt32(fileBytes, 4); + // string waveHeader = Encoding.ASCII.GetString(fileBytes, 8, 4); + // string fmtHeader = Encoding.ASCII.GetString(fileBytes, 12, 4); + // int fmtLength = BitConverter.ToInt32(fileBytes, 16); ushort formatType = BitConverter.ToUInt16(fileBytes, 20); - string formatCode = FormatCode(formatType); - ushort numChannels = BitConverter.ToUInt16(fileBytes, 22); - int sampleRate = BitConverter.ToInt32(fileBytes, 24); - int byteRate = BitConverter.ToInt32(fileBytes, 28); - - short blockAlign = BitConverter.ToInt16(fileBytes, 32); + // int byteRate = BitConverter.ToInt32(fileBytes, 28); + // short blockAlign = BitConverter.ToInt16(fileBytes, 32); short bitsPerSample = BitConverter.ToInt16(fileBytes, 34); - string dataHeader = Encoding.ASCII.GetString(fileBytes, 36, 4); // Check for "PAD" header and skip it if present int padSize = 0; while (dataHeader == "PAD ") { - padSize = padSize + BitConverter.ToInt32(fileBytes, 40); + padSize += BitConverter.ToInt32(fileBytes, 40); // we add 8 bits to padding as to skip the pad subchunk header + data - padSize = padSize + 8; + padSize += 8; // Skip the PAD section dataHeader = Encoding.ASCII.GetString(fileBytes, 36 + padSize, 4); @@ -107,7 +100,6 @@ public static SoundData ConvertWavByteArrayToFloatArray(byte[] fileBytes) }; } - private static float[] ConvertByteArrayToFloatArray(byte[] source, int headerOffset, BitDepth bit) { switch (bit)