diff --git a/Assets/Unheimlich_POC/Scenes/Sound Design Test/Hugo/HugoTestScene.unity b/Assets/Unheimlich_POC/Scenes/Sound Design Test/Hugo/HugoTestScene.unity index 17a3056e..e5db7e9c 100644 --- a/Assets/Unheimlich_POC/Scenes/Sound Design Test/Hugo/HugoTestScene.unity +++ b/Assets/Unheimlich_POC/Scenes/Sound Design Test/Hugo/HugoTestScene.unity @@ -131,7 +131,6 @@ GameObject: - component: {fileID: 245714137} - component: {fileID: 245714136} - component: {fileID: 245714135} - - component: {fileID: 245714139} m_Layer: 0 m_Name: Plane (1) m_TagString: carpet @@ -233,24 +232,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &245714139 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 245714134} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 380f7cbe5adf62244a5281fc7f50fe87, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Audio_SurfaceMaterial - _material: - idInternal: 0 - valueGuidInternal: [] - groupIdInternal: 0 - groupGuidInternal: [] - WwiseObjectReference: {fileID: 11400000, guid: cba7dd3dc6dddc744b665136cf09f95f, type: 2} --- !u!1001 &621599144 PrefabInstance: m_ObjectHideFlags: 0 @@ -431,14 +412,14 @@ MonoBehaviour: m_GameObject: {fileID: 661203441} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 380f7cbe5adf62244a5281fc7f50fe87, type: 3} + m_Script: {fileID: 11500000, guid: 3ec78f9fa08450a4fb1c6ef69da4e22c, type: 3} m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Audio_SurfaceMaterial - _material: + m_EditorClassIdentifier: Assembly-CSharp::Audio_SoundSurface + wwiseSwitch: idInternal: 0 - valueGuidInternal: [] + valueGuidInternal: groupIdInternal: 0 - groupGuidInternal: [] + groupGuidInternal: WwiseObjectReference: {fileID: 11400000, guid: 90b25d313fd10fe4bb34ce68d987f60e, type: 2} --- !u!1 &935580408 stripped GameObject: @@ -461,38 +442,16 @@ MonoBehaviour: idInternal: 0 valueGuidInternal: WwiseObjectReference: {fileID: 11400000, guid: 41aa8cbccefacf24b97ee9067316b3dc, type: 2} - surfaces: - - tag: stone - wwiseSwitch: - idInternal: 0 - valueGuidInternal: - groupIdInternal: 0 - groupGuidInternal: - WwiseObjectReference: {fileID: 11400000, guid: cea23ef8af49aa54f9c3833465570bb2, type: 2} - - tag: wood - wwiseSwitch: - idInternal: 0 - valueGuidInternal: - groupIdInternal: 0 - groupGuidInternal: - WwiseObjectReference: {fileID: 11400000, guid: 90b25d313fd10fe4bb34ce68d987f60e, type: 2} - - tag: carpet - wwiseSwitch: - idInternal: 0 - valueGuidInternal: - groupIdInternal: 0 - groupGuidInternal: - WwiseObjectReference: {fileID: 11400000, guid: cba7dd3dc6dddc744b665136cf09f95f, type: 2} defaultSwitch: idInternal: 0 valueGuidInternal: groupIdInternal: 0 groupGuidInternal: WwiseObjectReference: {fileID: 11400000, guid: cea23ef8af49aa54f9c3833465570bb2, type: 2} - stepInterval: 0.5 - minVelocity: 0.4 - rayDistance: 0.2 - groundLayer: + _stepInterval: 0.5 + _minVelocity: 0.3 + _rayDistance: 0.2 + _groundLayer: serializedVersion: 2 m_Bits: 4294967295 --- !u!1 &1391553828 @@ -675,15 +634,15 @@ MonoBehaviour: m_GameObject: {fileID: 1586552165} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 380f7cbe5adf62244a5281fc7f50fe87, type: 3} + m_Script: {fileID: 11500000, guid: 3ec78f9fa08450a4fb1c6ef69da4e22c, type: 3} m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Audio_SurfaceMaterial - _material: + m_EditorClassIdentifier: Assembly-CSharp::Audio_SoundSurface + wwiseSwitch: idInternal: 0 - valueGuidInternal: [] + valueGuidInternal: groupIdInternal: 0 - groupGuidInternal: [] - WwiseObjectReference: {fileID: 11400000, guid: 90b25d313fd10fe4bb34ce68d987f60e, type: 2} + groupGuidInternal: + WwiseObjectReference: {fileID: 11400000, guid: cba7dd3dc6dddc744b665136cf09f95f, type: 2} --- !u!1 &1758314271 GameObject: m_ObjectHideFlags: 0 @@ -807,14 +766,14 @@ MonoBehaviour: m_GameObject: {fileID: 1758314271} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 380f7cbe5adf62244a5281fc7f50fe87, type: 3} + m_Script: {fileID: 11500000, guid: 3ec78f9fa08450a4fb1c6ef69da4e22c, type: 3} m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Audio_SurfaceMaterial - _material: + m_EditorClassIdentifier: Assembly-CSharp::Audio_SoundSurface + wwiseSwitch: idInternal: 0 - valueGuidInternal: [] + valueGuidInternal: groupIdInternal: 0 - groupGuidInternal: [] + groupGuidInternal: WwiseObjectReference: {fileID: 11400000, guid: cea23ef8af49aa54f9c3833465570bb2, type: 2} --- !u!1001 &1930280930 PrefabInstance: @@ -1517,6 +1476,63 @@ MonoBehaviour: eventIdInternal: 0 valueGuidInternal: m_callbackDataInternal: {fileID: 0} +--- !u!1001 &1671855845641723936 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalPosition.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4395560298612109037, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6521978618824486866, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} + propertyPath: m_Name + value: AudioManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 61f7fe4128138164295ef34aae4f6659, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -1530,3 +1546,4 @@ SceneRoots: - {fileID: 245714138} - {fileID: 1586552169} - {fileID: 661203445} + - {fileID: 1671855845641723936} diff --git a/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_FootstepsController.cs b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_FootstepsController.cs index 91260844..25c89280 100644 --- a/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_FootstepsController.cs +++ b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_FootstepsController.cs @@ -16,7 +16,7 @@ public class Audio_FootstepsController : MonoBehaviour public AK.Wwise.Event footstepEvent; [Header("Surface Configuration")] - public List surfaces = new List(); + public AK.Wwise.Switch defaultSwitch; [Header("Movement Settings")] @@ -27,22 +27,11 @@ public class Audio_FootstepsController : MonoBehaviour private CharacterController _controller; private float _timer; - private Dictionary _surfaceCache; + void Awake() { _controller = GetComponent(); - - - _surfaceCache = new Dictionary(); - foreach (var mapping in surfaces) - { - if (!string.IsNullOrEmpty(mapping.tag)) - { - - _surfaceCache[mapping.tag.ToLower()] = mapping.wwiseSwitch; - } - } } void Update() @@ -67,19 +56,18 @@ public class Audio_FootstepsController : MonoBehaviour RaycastHit hit; if (Physics.Raycast(transform.position + Vector3.up * 0.1f, Vector3.down, out hit, _rayDistance, _groundLayer)) { - string currentTag = hit.collider.tag.ToLower(); - - if (_surfaceCache.TryGetValue(currentTag, out AK.Wwise.Switch targetSwitch)) + if (hit.collider.TryGetComponent(out var surface)) { - targetSwitch.SetValue(gameObject); - // Debug.Log($"[Footsteps] Switch Wwise set on : {currentTag}"); + surface.wwiseSwitch.SetValue(gameObject); } else { defaultSwitch.SetValue(gameObject); - Debug.LogWarning($"[Footsteps] Tag '{currentTag}' inconnu. Utilisation du switch par défaut."); + Debug.LogWarning($"[Footsteps] No GroundSurface component on '{hit.collider.name}'. Utilisation du switch par défaut."); } + + footstepEvent.Post(gameObject); } diff --git a/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs new file mode 100644 index 00000000..20508360 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs @@ -0,0 +1,7 @@ +using UnityEngine; +using AK.Wwise; + +public class Audio_SoundSurface : MonoBehaviour +{ + public AK.Wwise.Switch wwiseSwitch; +} diff --git a/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs.meta b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs.meta new file mode 100644 index 00000000..95a830ec --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Audio/Audio_SoundSurface.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3ec78f9fa08450a4fb1c6ef69da4e22c \ No newline at end of file diff --git a/Assets/Wwise/ScriptableObjects/State/5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C.asset b/Assets/Wwise/ScriptableObjects/State/5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C.asset index 8c0aa6d8..0c437ec4 100644 --- a/Assets/Wwise/ScriptableObjects/State/5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C.asset +++ b/Assets/Wwise/ScriptableObjects/State/5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C.asset @@ -15,4 +15,4 @@ MonoBehaviour: objectName: inStaircase id: 3708394339 guid: 5EE95D9E-014E-4A9E-880A-F1EEF0FE8D8C - WwiseStateGroupReference: {fileID: 0} + WwiseStateGroupReference: {fileID: 11400000, guid: ea33e74510b6ef84bbdde2121f209e13, type: 2} diff --git a/Assets/Wwise/ScriptableObjects/State/8952F29F-BE73-473A-9D08-8294D37259E7.asset b/Assets/Wwise/ScriptableObjects/State/8952F29F-BE73-473A-9D08-8294D37259E7.asset index 7b0fc9df..cdfa71ae 100644 --- a/Assets/Wwise/ScriptableObjects/State/8952F29F-BE73-473A-9D08-8294D37259E7.asset +++ b/Assets/Wwise/ScriptableObjects/State/8952F29F-BE73-473A-9D08-8294D37259E7.asset @@ -15,4 +15,4 @@ MonoBehaviour: objectName: inMenu id: 3374585465 guid: 8952F29F-BE73-473A-9D08-8294D37259E7 - WwiseStateGroupReference: {fileID: 0} + WwiseStateGroupReference: {fileID: 11400000, guid: ea33e74510b6ef84bbdde2121f209e13, type: 2} diff --git a/Assets/Wwise/ScriptableObjects/State/AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7.asset b/Assets/Wwise/ScriptableObjects/State/AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7.asset index b25061ee..42b9c7d6 100644 --- a/Assets/Wwise/ScriptableObjects/State/AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7.asset +++ b/Assets/Wwise/ScriptableObjects/State/AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7.asset @@ -15,4 +15,4 @@ MonoBehaviour: objectName: None id: 748895195 guid: AA82CE06-EC15-4AB6-A59B-BEDE7C5926C7 - WwiseStateGroupReference: {fileID: 0} + WwiseStateGroupReference: {fileID: 11400000, guid: ea33e74510b6ef84bbdde2121f209e13, type: 2} diff --git a/Assets/Wwise/ScriptableObjects/State/D325E2E9-6F95-4BA9-AF05-2C2E653106FA.asset b/Assets/Wwise/ScriptableObjects/State/D325E2E9-6F95-4BA9-AF05-2C2E653106FA.asset index 31df99a0..cd1ff702 100644 --- a/Assets/Wwise/ScriptableObjects/State/D325E2E9-6F95-4BA9-AF05-2C2E653106FA.asset +++ b/Assets/Wwise/ScriptableObjects/State/D325E2E9-6F95-4BA9-AF05-2C2E653106FA.asset @@ -15,4 +15,4 @@ MonoBehaviour: objectName: inSane id: 3719846035 guid: D325E2E9-6F95-4BA9-AF05-2C2E653106FA - WwiseStateGroupReference: {fileID: 0} + WwiseStateGroupReference: {fileID: 11400000, guid: ea33e74510b6ef84bbdde2121f209e13, type: 2} diff --git a/Assets/Wwise/ScriptableObjects/State/DD04671B-E8B5-4B1A-986A-579728855F92.asset b/Assets/Wwise/ScriptableObjects/State/DD04671B-E8B5-4B1A-986A-579728855F92.asset index 6459aa71..d84a5911 100644 --- a/Assets/Wwise/ScriptableObjects/State/DD04671B-E8B5-4B1A-986A-579728855F92.asset +++ b/Assets/Wwise/ScriptableObjects/State/DD04671B-E8B5-4B1A-986A-579728855F92.asset @@ -15,4 +15,4 @@ MonoBehaviour: objectName: inMad id: 1174700730 guid: DD04671B-E8B5-4B1A-986A-579728855F92 - WwiseStateGroupReference: {fileID: 0} + WwiseStateGroupReference: {fileID: 11400000, guid: ea33e74510b6ef84bbdde2121f209e13, type: 2}