Improve diapason

This commit is contained in:
2026-02-03 18:50:04 +01:00
parent 23d3cb5d2c
commit 71c44eb39e
12 changed files with 1172 additions and 602 deletions
@@ -19,7 +19,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -21.519, y: -80.993, z: 1.943}
value: {x: -13.962, y: -81.368, z: 3.173}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@@ -28,16 +28,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: -18.819, y: -81.149, z: 2.395}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.06666667
value: {x: -21.569, y: -80.99, z: 1.935}
value: {x: -8.964, y: -81.52, z: 3.94}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@@ -47,14 +38,14 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
path: Render
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.54888463, y: -0.15939617, z: 1.152984}
value: {x: 0.02978146, y: -0.008299127, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@@ -63,16 +54,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: 0.5675328, y: -0.16608095, z: 1.152984}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.06666667
value: {x: 0.5485432, y: -0.1592654, z: 1.152984}
value: {x: 0.06574321, y: -0.015231445, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
@@ -82,7 +64,7 @@ AnimationClip:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
path: Render
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
@@ -94,7 +76,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
path: 2482019420
attribute: 1
script: {fileID: 0}
typeID: 4
@@ -103,7 +85,7 @@ AnimationClip:
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 0
path: 2482019420
attribute: 4
script: {fileID: 0}
typeID: 4
@@ -117,7 +99,7 @@ AnimationClip:
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.06666667
m_StopTime: 0.05
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
@@ -139,7 +121,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 0.54888463
value: 0.02978146
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -148,16 +130,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.5675328
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.5485432
value: 0.06574321
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -168,7 +141,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
@@ -178,7 +151,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: -0.15939617
value: -0.008299127
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -187,16 +160,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: -0.16608095
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: -0.1592654
value: -0.015231445
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -207,7 +171,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
@@ -217,7 +181,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 1.152984
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -226,16 +190,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 1.152984
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 1.152984
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -246,7 +201,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
@@ -256,7 +211,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: -21.519
value: -13.962
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -265,16 +220,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: -18.819
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: -21.569
value: -8.964
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -285,7 +231,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 16
@@ -295,7 +241,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: -80.993
value: -81.368
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -304,16 +250,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: -81.149
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: -80.99
value: -81.52
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -324,7 +261,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 16
@@ -334,7 +271,7 @@ AnimationClip:
m_Curve:
- serializedVersion: 3
time: 0
value: 1.943
value: 3.173
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -343,16 +280,7 @@ AnimationClip:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 2.395
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 1.935
value: 3.94
inSlope: 0
outSlope: 0
tangentMode: 136
@@ -363,7 +291,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 16
@@ -376,7 +304,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
@@ -388,7 +316,7 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
@@ -400,10 +328,10 @@ AnimationClip:
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path:
path: Render
classID: 4
script: {fileID: 0}
flags: 0
m_HasGenericRootTransform: 1
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -1,5 +1,147 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1381762191753066586
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5740478472778989778}
- component: {fileID: 5267471927234851806}
- component: {fileID: 2498695925866410083}
- component: {fileID: 3597136791217450810}
- component: {fileID: 7569272480943586756}
m_Layer: 0
m_Name: Capsule (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5740478472778989778
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1381762191753066586}
serializedVersion: 2
m_LocalRotation: {x: -0.5742183, y: -0.14736228, z: 0.7800533, w: 0.20018607}
m_LocalPosition: {x: -0.961, y: 0.757, z: 0.756}
m_LocalScale: {x: 0.25, y: 0.5, z: 0.25}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3566501737476280457}
m_LocalEulerAnglesHint: {x: 0, y: -72.716, z: 151.213}
--- !u!33 &5267471927234851806
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1381762191753066586}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2498695925866410083
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1381762191753066586}
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_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 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_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &3597136791217450810
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1381762191753066586}
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.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &7569272480943586756
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1381762191753066586}
serializedVersion: 5
m_Mass: 1
m_LinearDamping: 0
m_AngularDamping: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1 &2911834610010628020
GameObject:
m_ObjectHideFlags: 0
@@ -90,6 +232,264 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2911834610010628020}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &3160628286671291482
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6609825781669214630}
- component: {fileID: 7095609529870862724}
- component: {fileID: 8750362618641014642}
- component: {fileID: 1473214508527721385}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6609825781669214630
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3160628286671291482}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.872, y: 1.28, z: 1.002}
m_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 3566501737476280457}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7095609529870862724
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3160628286671291482}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8750362618641014642
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3160628286671291482}
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_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 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_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &1473214508527721385
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3160628286671291482}
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_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &3850840283490192288
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4989552644080556030}
- component: {fileID: 1782302012954113280}
- component: {fileID: 7674897756009081809}
- component: {fileID: 8829434907447304672}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4989552644080556030
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850840283490192288}
serializedVersion: 2
m_LocalRotation: {x: -0.41919068, y: -0.41919068, z: 0.5694552, w: 0.5694552}
m_LocalPosition: {x: -1.125, y: 0.326, z: 0.181}
m_LocalScale: {x: 0.25, y: 0.53, z: 0.25}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3566501737476280457}
m_LocalEulerAnglesHint: {x: 0, y: -72.715, z: 90}
--- !u!33 &1782302012954113280
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850840283490192288}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7674897756009081809
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850840283490192288}
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_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 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_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &8829434907447304672
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3850840283490192288}
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.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4939242273377611689
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7995227628065693158}
m_Layer: 0
m_Name: ArmPivot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7995227628065693158
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4939242273377611689}
serializedVersion: 2
m_LocalRotation: {x: 0.25328645, y: -0.18117897, z: -0.13273516, w: 0.9409578}
m_LocalPosition: {x: -0.38364562, y: -0.17199996, z: 0.053447425}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3566501737476280457}
m_Father: {fileID: 487052691499411837}
m_LocalEulerAnglesHint: {x: 25.377, y: -26.859, z: -22.213}
--- !u!1 &5065452309140610958
GameObject:
m_ObjectHideFlags: 0
@@ -140,6 +540,40 @@ MonoBehaviour:
_walkBobSpeed: 15
_walkBobAmplitude: 0.1
_resetSpeed: 5
--- !u!1 &5252385172435588906
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3566501737476280457}
m_Layer: 0
m_Name: ArmDistance
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3566501737476280457
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5252385172435588906}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.19957, y: -0.28199998, z: 0.12099999}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4989552644080556030}
- {fileID: 5740478472778989778}
- {fileID: 6609825781669214630}
m_Father: {fileID: 7995227628065693158}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8240327778457960307
GameObject:
m_ObjectHideFlags: 0
@@ -183,7 +617,6 @@ Transform:
m_Children:
- {fileID: 6982185339454062415}
- {fileID: 7498738043038890726}
- {fileID: 253341405320884814}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &7491646674988902879
@@ -387,6 +820,10 @@ MonoBehaviour:
m_Calls: []
m_ActionId: 02f096f9-cab3-45f3-906c-5d551c7fca4f
m_ActionName: 'Player/Diapason[/Keyboard/tab]'
- m_PersistentCalls:
m_Calls: []
m_ActionId: a3ec6166-3b8f-4545-9fa4-40583be0fc66
m_ActionName: Player/Fire
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap:
@@ -499,7 +936,6 @@ MonoBehaviour:
_diapasonObject: {fileID: 3833126793998633073}
_diapasonAnimator: {fileID: 3326093237010115507}
_playerCamera: {fileID: 4106604842127079875}
_cursorTransform: {fileID: 0}
_listeningRange: 5
_listenableLayers:
serializedVersion: 2
@@ -535,13 +971,21 @@ MonoBehaviour:
_cameraPanSpeed: 2
_cameraPanBorderSize: 0.1
_maxCameraPanAngle: 15
_cameraAlignmentSpeed: 3
_cameraAlignmentThreshold: 0.5
_vignetteIntensity: 0.5
_vignetteEffect: {fileID: 3919526576499794210}
_handTouchFeedback: {fileID: 0}
_diapasonParticles: {fileID: 0}
_breathInClip: {fileID: 0}
_diapasonTapClip: {fileID: 0}
_diapasonTapVolume: 1
_ambientAttenuationAmount: 0.3
_audioFadeDuration: 0.5
_touchDistance: 2
_diapasonAction: {fileID: 0}
_lookAction: {fileID: 0}
_fireAction: {fileID: 0}
--- !u!114 &3919526576499794210
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -632,7 +1076,13 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 3994211764999481036, guid: e73a3b0e274984f4d8b6a073e03d4d03, type: 3}
insertIndex: -1
addedObject: {fileID: 253341405320884814}
- targetCorrespondingSourceObject: {fileID: 3994211764999481036, guid: e73a3b0e274984f4d8b6a073e03d4d03, type: 3}
insertIndex: -1
addedObject: {fileID: 7995227628065693158}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e73a3b0e274984f4d8b6a073e03d4d03, type: 3}
--- !u!4 &487052691499411837 stripped
@@ -656,48 +1106,76 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 5383576672370031505}
m_TransformParent: {fileID: 487052691499411837}
m_Modifications:
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.x
value: 0.572
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.y
value: -0.16753393
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.z
value: 1.1529833
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7519007
value: 0.75190187
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.x
value: -0.13395253
value: -0.13395086
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.y
value: -0.6397152
value: -0.6397146
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.z
value: -0.08640981
value: -0.08640652
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -18.179
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -81.182
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
- target: {fileID: 2315210776226997430, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 2.5
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.x
value: 0.78281003
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.y
value: -0.6192932
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalPosition.z
value: 1.138
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9926423
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalRotation.z
value: 0.121084325
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5629947512209565818, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 13.909
objectReference: {fileID: 0}
- target: {fileID: 8689584738786529861, guid: 2812cddb6de789b46ac9d640bb9ce410, type: 3}
propertyPath: m_Name
value: Diapason
File diff suppressed because one or more lines are too long
@@ -59,12 +59,6 @@ namespace Unheimlich.Audio
[SerializeField] private float _maxDistance = 10f;
[SerializeField] private AnimationCurve _distanceAttenuation = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
[Header("Vibration Settings")]
[SerializeField] private bool _enableVibration = true;
[SerializeField] private float _vibrationIntensityMin = 0.1f;
[SerializeField] private float _vibrationIntensityMax = 0.5f;
[SerializeField] private float _vibrationFrequency = 10f;
[Header("Visual Feedback")]
[SerializeField] private ParticleSystem _emitterParticles;
@@ -168,17 +162,6 @@ namespace Unheimlich.Audio
duration);
}
public void ResetConcentrationVolume()
{
TweenHelper.CancelTween(ref _concentrationFadeTweenId);
if (_continuousAudioSource == null)
return;
float baselineVolume = _continuousBaseVolume * BASELINE_VOLUME_MULTIPLIER;
_continuousAudioSource.volume = baselineVolume;
}
/// <summary>
/// Starts the listening sequence for this emitter.
/// Blocked if the emitter has already been tapped during this session.
@@ -253,9 +236,6 @@ namespace Unheimlich.Audio
_audioSource.loop = _loopStaticAudio;
_audioSource.Play();
}
if (_enableVibration)
StartVibration();
}
/// <summary>
@@ -295,7 +275,6 @@ namespace Unheimlich.Audio
}
EnableReverb(false);
StopVibration();
}
private void Update()
@@ -311,8 +290,6 @@ namespace Unheimlich.Audio
PlayProceduralSound();
_nextProceduralEventTime = _listeningTimer + Random.Range(_durationMin, _durationMax);
}
UpdateVibration();
}
@@ -420,39 +397,6 @@ namespace Unheimlich.Audio
}
}
private void StartVibration()
{
if (Gamepad.current == null)
return;
float distance = Vector3.Distance(_listenerPosition, transform.position);
float distanceFactor = Mathf.Clamp01(1f - (distance / _maxDistance));
float intensity = Mathf.Lerp(_vibrationIntensityMin, _vibrationIntensityMax, distanceFactor);
Gamepad.current.SetMotorSpeeds(intensity, intensity);
}
private void UpdateVibration()
{
if (!_enableVibration || Gamepad.current == null)
return;
float distance = Vector3.Distance(_listenerPosition, transform.position);
float distanceFactor = Mathf.Clamp01(1f - (distance / _maxDistance));
float intensity = Mathf.Lerp(_vibrationIntensityMin, _vibrationIntensityMax, distanceFactor);
float vibrationPattern = Mathf.Abs(Mathf.Sin(Time.time * _vibrationFrequency));
intensity *= vibrationPattern;
Gamepad.current.SetMotorSpeeds(intensity, intensity);
}
private void StopVibration()
{
if (Gamepad.current != null)
Gamepad.current.SetMotorSpeeds(0f, 0f);
}
private void OnDisable()
{
StopListening();
@@ -1,91 +0,0 @@
using UnityEngine;
using UnityEngine.Events;
namespace Unheimlich.Audio
{
public class AudioListenableEvent : MonoBehaviour
{
[Header("Event Settings")]
[SerializeField] private bool _triggerOnce = false;
[SerializeField] private float _delayBeforeEvent = 0f;
[Header("Events")]
[SerializeField] private UnityEvent _onListeningStarted;
[SerializeField] private UnityEvent _onListeningStopped;
[SerializeField] private UnityEvent _onFirstListen;
private AudioListenable _listenable;
private bool _hasBeenListenedTo = false;
private bool _isCurrentlyListening = false;
private void Awake()
{
_listenable = GetComponent<AudioListenable>();
if (_listenable == null)
{
Debug.LogError($"AudioListenableEvent on {gameObject.name} requires AudioListenable component!");
enabled = false;
}
}
private void Update()
{
if (_listenable == null)
return;
bool wasListening = _isCurrentlyListening;
if (wasListening && !_isCurrentlyListening)
{
OnListeningStopped();
}
}
public void OnListeningStart()
{
if (_triggerOnce && _hasBeenListenedTo)
return;
_isCurrentlyListening = true;
if (_delayBeforeEvent > 0)
Invoke(nameof(TriggerListeningStartedEvent), _delayBeforeEvent);
else
TriggerListeningStartedEvent();
if (!_hasBeenListenedTo)
{
_hasBeenListenedTo = true;
_onFirstListen?.Invoke();
}
}
private void TriggerListeningStartedEvent()
{
_onListeningStarted?.Invoke();
}
private void OnListeningStopped()
{
_isCurrentlyListening = false;
_onListeningStopped?.Invoke();
}
public void EnableListenable()
{
if (_listenable != null)
_listenable.enabled = true;
}
public void DisableListenable()
{
if (_listenable != null)
_listenable.enabled = false;
}
public void ResetTrigger()
{
_hasBeenListenedTo = false;
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 522dcfb634e07d240afa8ae5344fc785
@@ -249,36 +249,6 @@ namespace Unheimlich.Audio
}
}
private float CalculateVolumeFromDistance(float distance, AudioSource source)
{
float baseVolume = source.volume;
AudioSourceDemo demo = source.GetComponent<AudioSourceDemo>();
if (demo != null)
baseVolume = demo.OriginalVolume;
if (distance > source.maxDistance)
return 0f;
if (distance < source.minDistance)
return baseVolume;
switch (source.rolloffMode)
{
case AudioRolloffMode.Logarithmic:
float normalizedDist = (distance - source.minDistance) / (source.maxDistance - source.minDistance);
float logVolume = baseVolume * (1f / (1f + normalizedDist * 10f));
return logVolume * Mathf.Pow(1f - normalizedDist, _volumeRolloffPower);
case AudioRolloffMode.Linear:
float linearFactor = 1f - ((distance - source.minDistance) / (source.maxDistance - source.minDistance));
linearFactor = Mathf.Pow(linearFactor, _volumeRolloffPower);
return baseVolume * Mathf.Max(0f, linearFactor);
default:
return baseVolume;
}
}
private AudioSource GetOrCreateProxy(AudioSource remoteSource)
{
@@ -1,102 +0,0 @@
using UnityEngine;
namespace Unheimlich.Audio
{
[RequireComponent(typeof(AudioListenable))]
public class ThroughWallListener : MonoBehaviour
{
[Header("Behind Wall Detection")]
[SerializeField] private LayerMask _detectionLayers;
[SerializeField] private float _detectionDistance = 2f;
[SerializeField] private float _detectionRadius = 1f;
[Header("Audio Feedback")]
[SerializeField] private AudioClip _nothingBehindClip;
[SerializeField] private AudioClip _somethingBehindClip;
[SerializeField] private AudioClip _importantObjectClip;
[SerializeField] private string _importantObjectTag = "Important";
[Header("Visual Feedback")]
[SerializeField] private GameObject _highlightEffectPrefab;
[SerializeField] private float _highlightDuration = 3f;
private AudioSource _audioSource;
private AudioListenable _listenable;
private GameObject _currentHighlight;
private void Awake()
{
_listenable = GetComponent<AudioListenable>();
_audioSource = GetComponent<AudioSource>();
if (_audioSource == null)
_audioSource = gameObject.AddComponent<AudioSource>();
}
private void Update()
{
}
public void OnWallListened()
{
Vector3 checkPosition = transform.position + transform.forward * (_detectionDistance * 0.5f);
Collider[] hitColliders = Physics.OverlapSphere(checkPosition, _detectionRadius, _detectionLayers);
if (hitColliders.Length > 0)
{
bool foundImportant = false;
foreach (Collider col in hitColliders)
{
if (col.CompareTag(_importantObjectTag))
{
foundImportant = true;
PlayFeedbackSound(_importantObjectClip);
ShowHighlight(col.transform.position);
break;
}
}
if (!foundImportant)
{
PlayFeedbackSound(_somethingBehindClip);
}
}
else
{
PlayFeedbackSound(_nothingBehindClip);
}
}
private void PlayFeedbackSound(AudioClip clip)
{
if (clip != null && _audioSource != null)
{
_audioSource.PlayOneShot(clip);
}
}
private void ShowHighlight(Vector3 position)
{
if (_highlightEffectPrefab != null)
{
if (_currentHighlight != null)
Destroy(_currentHighlight);
_currentHighlight = Instantiate(_highlightEffectPrefab, position, Quaternion.identity);
Destroy(_currentHighlight, _highlightDuration);
}
}
private void OnDrawGizmosSelected()
{
Gizmos.color = Color.yellow;
Vector3 checkPosition = transform.position + transform.forward * (_detectionDistance * 0.5f);
Gizmos.DrawWireSphere(checkPosition, _detectionRadius);
Gizmos.color = Color.blue;
Gizmos.DrawRay(transform.position, transform.forward * _detectionDistance);
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 3fad34f7be8a64242984b14410478690
@@ -1,181 +0,0 @@
using UnityEngine;
using UnityEditor;
using Unheimlich.Audio;
namespace Unheimlich.Editor
{
public class AudioListenableBatchSetup : EditorWindow
{
private AudioEmitterType _selectedType = AudioEmitterType.Wall;
private LayerMask _targetLayer;
private bool _overwriteExisting = false;
[MenuItem("Tools/Unheimlich/Audio Listenable Batch Setup")]
public static void ShowWindow()
{
GetWindow<AudioListenableBatchSetup>("Audio Batch Setup");
}
private void OnGUI()
{
GUILayout.Label("Batch Audio Listenable Setup", EditorStyles.boldLabel);
EditorGUILayout.Space(10);
EditorGUILayout.HelpBox(
"This tool adds AudioListenable components to all selected GameObjects in the scene.",
MessageType.Info
);
EditorGUILayout.Space(5);
_selectedType = (AudioEmitterType)EditorGUILayout.EnumPopup("Emitter Type", _selectedType);
_overwriteExisting = EditorGUILayout.Toggle("Overwrite Existing", _overwriteExisting);
EditorGUILayout.Space(10);
if (GUILayout.Button("Add to Selected Objects", GUILayout.Height(30)))
{
AddToSelectedObjects();
}
EditorGUILayout.Space(5);
EditorGUILayout.LabelField("Quick Presets", EditorStyles.boldLabel);
if (GUILayout.Button("Setup All Walls in Scene"))
{
SetupObjectsByName("wall", AudioEmitterType.Wall);
}
if (GUILayout.Button("Setup All Doors in Scene"))
{
SetupObjectsByName("door", AudioEmitterType.Wood);
}
}
private void AddToSelectedObjects()
{
GameObject[] selectedObjects = Selection.gameObjects;
if (selectedObjects.Length == 0)
{
EditorUtility.DisplayDialog("No Selection", "Please select at least one GameObject in the scene.", "OK");
return;
}
int addedCount = 0;
int skippedCount = 0;
foreach (GameObject obj in selectedObjects)
{
AudioListenable existing = obj.GetComponent<AudioListenable>();
if (existing != null && !_overwriteExisting)
{
skippedCount++;
continue;
}
if (existing == null)
{
Undo.AddComponent<AudioListenable>(obj);
existing = obj.GetComponent<AudioListenable>();
}
ConfigureListenable(existing, _selectedType);
addedCount++;
}
EditorUtility.DisplayDialog(
"Batch Setup Complete",
$"Added/Updated: {addedCount}\nSkipped: {skippedCount}",
"OK"
);
}
private void SetupObjectsByName(string nameContains, AudioEmitterType type)
{
GameObject[] allObjects = FindObjectsByType<GameObject>(FindObjectsSortMode.None);
int count = 0;
foreach (GameObject obj in allObjects)
{
if (obj.name.ToLower().Contains(nameContains.ToLower()))
{
AudioListenable existing = obj.GetComponent<AudioListenable>();
if (existing == null)
{
Undo.AddComponent<AudioListenable>(obj);
existing = obj.GetComponent<AudioListenable>();
}
ConfigureListenable(existing, type);
count++;
}
}
EditorUtility.DisplayDialog(
"Setup Complete",
$"Configured {count} objects containing '{nameContains}' as {type}",
"OK"
);
}
private void ConfigureListenable(AudioListenable listenable, AudioEmitterType type)
{
SerializedObject so = new SerializedObject(listenable);
so.FindProperty("_emitterType").enumValueIndex = (int)type;
so.FindProperty("_useProceduralAudio").boolValue = true;
switch (type)
{
case AudioEmitterType.Wall:
so.FindProperty("_baseFrequency").floatValue = 200f;
so.FindProperty("_frequencyVariation").floatValue = 20f;
so.FindProperty("_volumeMin").floatValue = 0.2f;
so.FindProperty("_volumeMax").floatValue = 0.4f;
break;
case AudioEmitterType.Metal:
so.FindProperty("_baseFrequency").floatValue = 800f;
so.FindProperty("_frequencyVariation").floatValue = 100f;
so.FindProperty("_volumeMin").floatValue = 0.4f;
so.FindProperty("_volumeMax").floatValue = 0.7f;
break;
case AudioEmitterType.Wood:
so.FindProperty("_baseFrequency").floatValue = 300f;
so.FindProperty("_frequencyVariation").floatValue = 50f;
so.FindProperty("_volumeMin").floatValue = 0.3f;
so.FindProperty("_volumeMax").floatValue = 0.6f;
break;
case AudioEmitterType.Glass:
so.FindProperty("_baseFrequency").floatValue = 1200f;
so.FindProperty("_frequencyVariation").floatValue = 150f;
so.FindProperty("_volumeMin").floatValue = 0.3f;
so.FindProperty("_volumeMax").floatValue = 0.6f;
break;
case AudioEmitterType.Stone:
so.FindProperty("_baseFrequency").floatValue = 250f;
so.FindProperty("_frequencyVariation").floatValue = 30f;
so.FindProperty("_volumeMin").floatValue = 0.3f;
so.FindProperty("_volumeMax").floatValue = 0.5f;
break;
case AudioEmitterType.Mechanical:
so.FindProperty("_baseFrequency").floatValue = 500f;
so.FindProperty("_frequencyVariation").floatValue = 80f;
so.FindProperty("_volumeMin").floatValue = 0.4f;
so.FindProperty("_volumeMax").floatValue = 0.7f;
break;
}
so.ApplyModifiedProperties();
EditorUtility.SetDirty(listenable);
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5d813501fc2b446419db87d892d79ce3
@@ -4,6 +4,7 @@ using UnityEngine.InputSystem;
using Unheimlich.Audio;
using Unheimlich.Core;
using Unheimlich.Utility;
using Unheimlich.Gameplay.Player;
using InputManager = Unheimlich.Managers.PlayerInputManager;
namespace Unheimlich.Gameplay.Player
@@ -38,11 +39,14 @@ namespace Unheimlich.Gameplay.Player
[SerializeField] private float _diapasonTweenDuration = 0.3f;
[SerializeField] private float _diapasonHideOffset = -0.5f;
[SerializeField] private AnimationCurve _diapasonTweenCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
[SerializeField] private float _vibrationDuration = 15f;
[Header("Camera Settings")]
[SerializeField] private float _cameraPanSpeed = 2f;
[SerializeField] private float _cameraPanBorderSize = 0.1f;
[SerializeField] private float _maxCameraPanAngle = 15f;
[SerializeField] private float _cameraAlignmentSpeed = 3f;
[SerializeField] private float _cameraAlignmentThreshold = 0.5f;
[Header("Visual Feedback")]
[SerializeField] private float _vignetteIntensity = 0.5f;
@@ -78,8 +82,14 @@ namespace Unheimlich.Gameplay.Player
private float _originalAmbientVolume;
private Vector3 _diapasonEquippedPosition;
private Vector3 _diapasonHiddenPosition;
private Vector3 _originalCameraLocalPosition;
private Vector3 _originalPlayerPosition;
private Vector3 _originalPlayerRotation;
private Vector3 _originalCameraLocalRotation;
private bool _canUseDiapason;
private bool _isFadingOutConcentration;
private Coroutine _returnCoroutine;
private Coroutine _vibrationCoroutine;
protected override void OnAwake()
{
@@ -87,6 +97,15 @@ namespace Unheimlich.Gameplay.Player
if (_playerAudioSource == null)
_playerAudioSource = gameObject.AddComponent<AudioSource>();
if (_playerCamera != null)
{
_originalCameraLocalPosition = _playerCamera.transform.localPosition;
_originalCameraLocalRotation = _playerCamera.transform.localEulerAngles;
}
_originalPlayerPosition = transform.position;
_originalPlayerRotation = transform.eulerAngles;
if (_diapasonObject != null)
{
_diapasonEquippedPosition = _diapasonObject.transform.localPosition;
@@ -222,10 +241,11 @@ namespace Unheimlich.Gameplay.Player
/// <summary>
/// Main listening sequence coroutine:
/// 1. Concentration phase - player breathes in, diapason animates out
/// 2. Volume fades from 30% to 100% during concentration
/// 3. After concentration duration, enters listening mode
/// 4. Vignette appears, camera pan enabled, cursor shown
/// 1. Camera aligns perpendicular to the target object
/// 2. Concentration phase - player breathes in, diapason animates out
/// 3. Volume fades from 30% to 100% during concentration
/// 4. After concentration duration, enters listening mode
/// 5. Vignette appears, camera pan enabled, cursor shown
/// </summary>
private IEnumerator ListeningSequence()
{
@@ -233,8 +253,12 @@ namespace Unheimlich.Gameplay.Player
InputManager.SetContext(InputManager.InputContext.Listening);
if (_currentTargetEmitter != null)
{
_currentTargetEmitter.SetConcentrating(true);
yield return StartCoroutine(AlignCameraToTarget(_currentTargetEmitter.transform));
}
if (_diapasonObject != null)
{
TweenHelper.CancelTween(ref _diapasonTweenId);
@@ -281,6 +305,8 @@ namespace Unheimlich.Gameplay.Player
/// - Stops emitter listening
/// - Hides vignette and cursor
/// - Re-enables player movement
/// - Restores player position, rotation and camera with lerp
/// - Resets diapason animation to idle
/// </summary>
private void StopListeningMode()
{
@@ -290,9 +316,21 @@ namespace Unheimlich.Gameplay.Player
_listeningCoroutine = null;
}
if (_vibrationCoroutine != null)
{
StopCoroutine(_vibrationCoroutine);
_vibrationCoroutine = null;
}
IsListening = false;
IsConcentrating = false;
if (_returnCoroutine != null)
{
StopCoroutine(_returnCoroutine);
}
_returnCoroutine = StartCoroutine(ReturnToOriginalPosition());
if (_playerAudioSource != null && _playerAudioSource.isPlaying)
{
TweenHelper.CancelTween(ref _playerAudioFadeTweenId);
@@ -317,6 +355,7 @@ namespace Unheimlich.Gameplay.Player
if (_diapasonAnimator != null)
{
_diapasonAnimator.SetBool(ANIM_BOOL_VIBRATING, false);
_diapasonAnimator.Play("Idle", 0, 0f);
_diapasonAnimator.enabled = false;
}
@@ -364,6 +403,127 @@ namespace Unheimlich.Gameplay.Player
_isFadingOutConcentration = false;
}
/// <summary>
/// Aligns the player and camera to the target object:
/// - Player moves along target's local X axis to align with target center
/// - Player rotates to face the target
/// - Camera pitch adjusts to look at target center
/// </summary>
private IEnumerator AlignCameraToTarget(Transform target)
{
if (_playerCamera == null || target == null)
yield break;
_originalCameraLocalPosition = _playerCamera.transform.localPosition;
_originalCameraLocalRotation = _playerCamera.transform.localEulerAngles;
_originalPlayerPosition = transform.position;
_originalPlayerRotation = transform.eulerAngles;
Vector3 targetCenter = target.position;
Renderer targetRenderer = target.GetComponent<Renderer>();
if (targetRenderer != null)
{
targetCenter = targetRenderer.bounds.center;
}
else
{
Collider targetCollider = target.GetComponent<Collider>();
if (targetCollider != null)
targetCenter = targetCollider.bounds.center;
}
Vector3 startPlayerPos = transform.position;
Vector3 startPlayerRotation = transform.eulerAngles;
Vector3 startCameraLocalRotation = _playerCamera.transform.localEulerAngles;
float startPitch = startCameraLocalRotation.x;
if (startPitch > 180f)
startPitch -= 360f;
float elapsed = 0f;
float duration = 1f / _cameraAlignmentSpeed;
while (elapsed < duration)
{
elapsed += Time.deltaTime;
float t = Mathf.SmoothStep(0f, 1f, elapsed / duration);
Vector3 currentCameraPos = _playerCamera.transform.position;
Vector3 toTarget = targetCenter - currentCameraPos;
Vector3 directionToTarget = toTarget.normalized;
Quaternion targetRotation = Quaternion.LookRotation(directionToTarget);
float targetYaw = targetRotation.eulerAngles.y;
float targetPitch = -Mathf.Asin(directionToTarget.y) * Mathf.Rad2Deg;
Vector3 targetRightAxis = target.right;
Vector3 playerToTargetCenter = targetCenter - transform.position;
float offsetAlongTargetRight = Vector3.Dot(playerToTargetCenter, targetRightAxis);
Vector3 targetPlayerPos = transform.position + targetRightAxis * offsetAlongTargetRight;
Vector3 currentPlayerPos = Vector3.Lerp(startPlayerPos, targetPlayerPos, t);
transform.position = currentPlayerPos;
float currentYaw = Mathf.LerpAngle(startPlayerRotation.y, targetYaw, t);
transform.eulerAngles = new Vector3(0f, currentYaw, 0f);
float currentPitch = Mathf.LerpAngle(startPitch, targetPitch, t);
_playerCamera.transform.localEulerAngles = new Vector3(currentPitch, 0f, 0f);
yield return null;
}
}
/// <summary>
/// Returns player and camera to original position and rotation with smooth lerp.
/// </summary>
private IEnumerator ReturnToOriginalPosition()
{
if (_playerCamera == null)
yield break;
Vector3 startPlayerPos = transform.position;
Vector3 startPlayerRotation = transform.eulerAngles;
Vector3 startCameraLocalPos = _playerCamera.transform.localPosition;
Vector3 startCameraLocalRotation = _playerCamera.transform.localEulerAngles;
float startPitch = startCameraLocalRotation.x;
if (startPitch > 180f)
startPitch -= 360f;
float targetPitch = _originalCameraLocalRotation.x;
if (targetPitch > 180f)
targetPitch -= 360f;
float elapsed = 0f;
float duration = 1f / _cameraAlignmentSpeed;
while (elapsed < duration)
{
elapsed += Time.deltaTime;
float t = Mathf.SmoothStep(0f, 1f, elapsed / duration);
transform.position = Vector3.Lerp(startPlayerPos, _originalPlayerPosition, t);
float currentYaw = Mathf.LerpAngle(startPlayerRotation.y, _originalPlayerRotation.y, t);
transform.eulerAngles = new Vector3(0f, currentYaw, 0f);
float currentPitch = Mathf.LerpAngle(startPitch, targetPitch, t);
_playerCamera.transform.localEulerAngles = new Vector3(currentPitch, 0f, 0f);
_playerCamera.transform.localPosition = Vector3.Lerp(startCameraLocalPos, _originalCameraLocalPosition, t);
yield return null;
}
transform.position = _originalPlayerPosition;
transform.eulerAngles = _originalPlayerRotation;
_playerCamera.transform.localPosition = _originalCameraLocalPosition;
_playerCamera.transform.localEulerAngles = _originalCameraLocalRotation;
_returnCoroutine = null;
}
/// <summary>
/// Updates cursor position and camera panning during listening mode.
/// Supports both gamepad (look input) and mouse (screen edges).
@@ -485,6 +645,7 @@ namespace Unheimlich.Gameplay.Player
/// - Starts listening sequence on the target emitter
/// - Plays diapason particles
/// - Plays tap sound
/// - Starts vibration timer to stop after duration
/// </summary>
private void TriggerDiapasonTap()
{
@@ -492,6 +653,10 @@ namespace Unheimlich.Gameplay.Player
{
_diapasonAnimator.SetTrigger(ANIM_TRIGGER_TAP);
_diapasonAnimator.SetBool(ANIM_BOOL_VIBRATING, true);
if (_vibrationCoroutine != null)
StopCoroutine(_vibrationCoroutine);
_vibrationCoroutine = StartCoroutine(StopVibrationAfterDuration());
}
if (_diapasonTapClip != null && _playerAudioSource != null)
@@ -510,6 +675,21 @@ namespace Unheimlich.Gameplay.Player
}
}
/// <summary>
/// Stops the diapason vibration animation after the specified duration.
/// </summary>
private IEnumerator StopVibrationAfterDuration()
{
yield return new WaitForSeconds(_vibrationDuration);
if (_diapasonAnimator != null)
{
_diapasonAnimator.SetBool(ANIM_BOOL_VIBRATING, false);
}
_vibrationCoroutine = null;
}
private void PlayBreathIn()
{
if (_breathInClip != null && _playerAudioSource != null)