浏览代码

Audio changes

/UI
Ciro Continisio 4 年前
当前提交
70978d9d
共有 40 个文件被更改,包括 259 次插入77 次删除
  1. 4
      UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
  2. 113
      UOP1_Project/Assets/Scenes/Locations/Beach.unity
  3. 2
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/2.5DSFX_Config.asset
  4. 2
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset
  5. 11
      UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Beach.asset
  6. 11
      UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Glade.asset
  7. 44
      UOP1_Project/Assets/Scripts/Audio/AudioManager.cs
  8. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/AudioCueEventChannelSO.cs
  9. 3
      UOP1_Project/Assets/Scripts/SceneManagement/ScriptableObjects/LocationSO.cs
  10. 1
      UOP1_Project/Assets/Settings/Audio/DefaultAudioMixer.mixer
  11. 2
      UOP1_Project/Assets/WIP_Prefabs.meta
  12. 2
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset
  13. 8
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX.meta
  14. 28
      UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs
  15. 11
      UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs.meta
  16. 19
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Beach.asset
  17. 19
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Glade.asset
  18. 8
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Glade.asset.meta
  19. 38
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Sand.asset
  20. 8
      UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Sand.asset.meta
  21. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset.meta
  22. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset
  23. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music.meta
  24. 0
      /UOP1_Project/Assets/WIP_Prefabs/Salad.prefab
  25. 0
      /UOP1_Project/Assets/WIP_Prefabs/Salad.prefab.meta
  26. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Fire_looping.asset.meta
  27. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Fire_looping.asset
  28. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset
  29. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset.meta
  30. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Jump.asset
  31. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_PickUp.asset
  32. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_SwingCane.asset
  33. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_SwingCane.asset.meta
  34. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_PickUp.asset.meta
  35. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Jump.asset.meta
  36. 0
      /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Beach.asset.meta

4
UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab


m_Name:
m_EditorClassIdentifier:
_sfxEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e, type: 2}
_audioConfig: {fileID: 11400000, guid: 6b42c99763682d64ba019b447d78be04, type: 2}
_audioConfig: {fileID: 11400000, guid: 046cbfdf9a2c0964ea8a01b8e3814e51, type: 2}
footstep: {fileID: 11400000, guid: ddb0fd735bd6f904eaae159c865eb35f, type: 2}
footstep: {fileID: 11400000, guid: 412141fe54999534a8d2800c2a567b55, type: 2}
--- !u!114 &5557640735889932260
MonoBehaviour:
m_ObjectHideFlags: 0

113
UOP1_Project/Assets/Scenes/Locations/Beach.unity


- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}
propertyPath: m_RootOrder
value: 9
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1001 &402461090
PrefabInstance:

- target: {fileID: 5215257785267415874, guid: 647ea42d84b3f17469f1992b976ab5bb,
type: 3}
propertyPath: m_RootOrder
value: 30
value: 31
objectReference: {fileID: 0}
- target: {fileID: 5215257785267415874, guid: 647ea42d84b3f17469f1992b976ab5bb,
type: 3}

m_LocalScale: {x: 100, y: 1, z: 100}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 22
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &674609686
GameObject:

m_Children:
- {fileID: 534203084}
m_Father: {fileID: 0}
m_RootOrder: 20
m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &682182498
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 19
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &764049134
PrefabInstance:

- target: {fileID: 2125786285293829335, guid: e978d53d440e0814086759404585ac32,
type: 3}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 2125786285293829335, guid: e978d53d440e0814086759404585ac32,
type: 3}

m_LocalScale: {x: 6.2555, y: 3.6674, z: 3.0208502}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 30.526001, z: 0}
--- !u!114 &1021375555
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 54f92f965dbe44449b252b814ddc7137, type: 3}
m_Name:
m_EditorClassIdentifier:
_audioCue: {fileID: 11400000, guid: 68848f118f687254baf4d4e2f4bfbe65, type: 2}
_audioCue: {fileID: 0}
_playOnStart: 0
_audioCueEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e,
type: 2}

- target: {fileID: 4578008936480288453, guid: c8cca569043f8f242b8293341538d805,
type: 3}
propertyPath: m_RootOrder
value: 26
value: 27
objectReference: {fileID: 0}
- target: {fileID: 4578008936480288453, guid: c8cca569043f8f242b8293341538d805,
type: 3}

- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}

type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3b5498e27a52ce243b2ce35ba305d864, type: 3}
--- !u!1 &1213892518
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1213892520}
- component: {fileID: 1213892519}
m_Layer: 0
m_Name: MusicPlayer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1213892519
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213892518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bac00fb906d5ce448625eccf4aa04ec, type: 3}
m_Name:
m_EditorClassIdentifier:
_onSceneReady: {fileID: 11400000, guid: b729e40fc41dd8b4ea7aaf5c857f7186, type: 2}
_playMusicOn: {fileID: 11400000, guid: 51854f522e1d88442a90b878b27ea839, type: 2}
_thisSceneSO: {fileID: 11400000, guid: 2f386bbc670c05145834a0f9c7d55798, type: 2}
_audioConfig: {fileID: 11400000, guid: 7dc92129d2e4ae84dabc197b593ba446, type: 2}
--- !u!4 &1213892520
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213892518}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1443998548
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 100, y: 1, z: 100}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 21
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1481348462
GameObject:

m_LocalScale: {x: 12.369, y: 7.25155, z: 5.9731274}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 82.234, z: 0}
--- !u!1 &1814819702
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1835452175
PrefabInstance:

- target: {fileID: 2723178623857253410, guid: 7f3c311f1ca46334ab26b1adfc5be02f,
type: 3}
propertyPath: m_RootOrder
value: 29
value: 30
objectReference: {fileID: 0}
- target: {fileID: 2723178623857253410, guid: 7f3c311f1ca46334ab26b1adfc5be02f,
type: 3}

- target: {fileID: 4336536613454148666, guid: adbee91cfe65b4a4b8f1ea3316dbcb5b,
type: 3}
propertyPath: m_RootOrder
value: 28
value: 29
objectReference: {fileID: 0}
- target: {fileID: 4336536613454148666, guid: adbee91cfe65b4a4b8f1ea3316dbcb5b,
type: 3}

m_Script: {fileID: 11500000, guid: 54f92f965dbe44449b252b814ddc7137, type: 3}
m_Name:
m_EditorClassIdentifier:
_audioCue: {fileID: 11400000, guid: 68848f118f687254baf4d4e2f4bfbe65, type: 2}
_audioCue: {fileID: 0}
_playOnStart: 0
_audioCueEventChannel: {fileID: 11400000, guid: c3c796b7c31ad3647a3fbae42e74764e,
type: 2}

m_LocalScale: {x: 6.2555, y: 3.6674, z: 3.0208502}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 76.899, z: 0}
--- !u!1001 &1899846896
PrefabInstance:

- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}
propertyPath: m_RootOrder
value: 10
value: 11
objectReference: {fileID: 0}
- target: {fileID: 5540501665159811850, guid: 3b5498e27a52ce243b2ce35ba305d864,
type: 3}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1928770499
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1958420419
GameObject:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2046241436
PrefabInstance:

- target: {fileID: 2955398947125553842, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_LocalRotation.z
value: -0.11854541
value: -0.118545376
objectReference: {fileID: 0}
- target: {fileID: 8745341640208226293, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}

- target: {fileID: 8745341640208226295, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 8745341640208226295, guid: 45632f0a227c860489bcba0eb1f4ec3e,
type: 3}

- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 40564194958535909, guid: 54d1f8b93400ea64d97c276fab375df3,
type: 3}

- target: {fileID: 2397232258201416951, guid: 2b0687cec5da670488d4dc3627e6ea49,
type: 3}
propertyPath: m_RootOrder
value: 16
value: 17
objectReference: {fileID: 0}
- target: {fileID: 2397232258201416951, guid: 2b0687cec5da670488d4dc3627e6ea49,
type: 3}

- target: {fileID: 2543186840983142744, guid: cd349fd75563ded46bf218c75f16a1f5,
type: 3}
propertyPath: m_RootOrder
value: 27
value: 28
objectReference: {fileID: 0}
- target: {fileID: 2543186840983142744, guid: cd349fd75563ded46bf218c75f16a1f5,
type: 3}

- target: {fileID: 2892076701290493137, guid: 23735bc8688dbfe429c6bf9ae25d7cd8,
type: 3}
propertyPath: m_RootOrder
value: 15
value: 16
objectReference: {fileID: 0}
- target: {fileID: 2892076701290493137, guid: 23735bc8688dbfe429c6bf9ae25d7cd8,
type: 3}

- target: {fileID: 3769111898081533676, guid: 0e833246093ee8b43aa849cd306ddaa8,
type: 3}
propertyPath: m_RootOrder
value: 18
value: 19
objectReference: {fileID: 0}
- target: {fileID: 3769111898081533676, guid: 0e833246093ee8b43aa849cd306ddaa8,
type: 3}

- target: {fileID: 5426752796581055613, guid: 4c96eefe12d9d2b4da051ac1e459080a,
type: 3}
propertyPath: m_RootOrder
value: 24
value: 25
objectReference: {fileID: 0}
- target: {fileID: 5426752796581055613, guid: 4c96eefe12d9d2b4da051ac1e459080a,
type: 3}

- target: {fileID: 8480342874862479705, guid: 58b2fce34466e6e40963f42dfd5ffa61,
type: 3}
propertyPath: m_RootOrder
value: 17
value: 18
objectReference: {fileID: 0}
- target: {fileID: 8480342874862479705, guid: 58b2fce34466e6e40963f42dfd5ffa61,
type: 3}

- target: {fileID: 4492041825994751890, guid: ef9e28c2d08876542860097704aa63b2,
type: 3}
propertyPath: m_RootOrder
value: 25
value: 26
objectReference: {fileID: 0}
- target: {fileID: 4492041825994751890, guid: ef9e28c2d08876542860097704aa63b2,
type: 3}

- target: {fileID: 9223003383603547671, guid: c00f714522ff4b74cab5680809e09e67,
type: 3}
propertyPath: m_RootOrder
value: 23
value: 24
objectReference: {fileID: 0}
- target: {fileID: 9223003383603547671, guid: c00f714522ff4b74cab5680809e09e67,
type: 3}

2
UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/2.5DSFX_Config.asset


m_Script: {fileID: 11500000, guid: b357a35b19afa6e4ca9ed9cc1830f6de, type: 3}
m_Name: 2.5DSFX_Config
m_EditorClassIdentifier:
OutputAudioMixerGroup: {fileID: 8911742078530553623, guid: 548a7f001ca6d3d4cb67c8edf84f62a3,
OutputAudioMixerGroup: {fileID: -6246855377066869883, guid: 548a7f001ca6d3d4cb67c8edf84f62a3,
type: 2}
_priorityLevel: 128
Mute: 0

2
UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b357a35b19afa6e4ca9ed9cc1830f6de, type: 3}
m_Name: 2DSFX_Config
m_Name: UISFX_Config
m_EditorClassIdentifier:
OutputAudioMixerGroup: {fileID: 8911742078530553623, guid: 548a7f001ca6d3d4cb67c8edf84f62a3,
type: 2}

11
UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Beach.asset


m_Script: {fileID: 11500000, guid: 8db63739a6674d74e8e232347422172f, type: 3}
m_Name: Beach
m_EditorClassIdentifier:
uuid:
uuid: 9b8c3478-f2b2-4346-a969-d04f92c809b7
sceneAsset: {fileID: 102900000, guid: dfaf60263d5c5dc4e80e2793f4328b32, type: 3}
scenePath: Assets/Scenes/Locations/Beach.unity
shortDescription: The level to find X
music: {fileID: 0}
_guid: 2f386bbc670c05145834a0f9c7d55798
sceneType: 0
shortDescription:
locationName:
m_TableReference:
m_TableCollectionName: GUID:5f392fa78068846188a7ed5595276c8f

m_FallbackState: 0
musicTrack: {fileID: 0}
musicTrack: {fileID: 11400000, guid: 8581dd3dfa47c5c46b3ddf5a2d6f6e4e, type: 2}

11
UOP1_Project/Assets/ScriptableObjects/SceneData/Locations/Glade.asset


m_Script: {fileID: 11500000, guid: 8db63739a6674d74e8e232347422172f, type: 3}
m_Name: Glade
m_EditorClassIdentifier:
uuid:
uuid: beb088ab-40f0-4c23-b0d4-08f05b41e310
sceneAsset: {fileID: 102900000, guid: 92a4a277a346e4344b629ad5613f7c51, type: 3}
scenePath: Assets/Scenes/Locations/Glade.unity
shortDescription: Glade Location
music: {fileID: 0}
_guid: 3902a4362b3a4fb4ab5ce5dcc07d8427
sceneType: 0
shortDescription:
locationName:
m_TableReference:
m_TableCollectionName: GUID:5f392fa78068846188a7ed5595276c8f

m_FallbackState: 0
musicTrack: {fileID: 0}
musicTrack: {fileID: 11400000, guid: 8581dd3dfa47c5c46b3ddf5a2d6f6e4e, type: 2}

44
UOP1_Project/Assets/Scripts/Audio/AudioManager.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using System;
public class AudioManager : MonoBehaviour
{

//TODO: Get the initial volume levels from the settings
_soundEmitterList = new SoundEmitterList();
RegisterChannel(_SFXEventChannel);
RegisterChannel(_musicEventChannel); //TODO: Treat music requests differently?
private void OnEnable()
{
_SFXEventChannel.OnAudioCuePlayRequested += PlayAudioCue;
_SFXEventChannel.OnAudioCueStopRequested += StopAudioCue;
_SFXEventChannel.OnAudioCueFinishRequested += FinishAudioCue;
_musicEventChannel.OnAudioCuePlayRequested += PlayMusicTrack;
}
UnregisterChannel(_SFXEventChannel);
UnregisterChannel(_musicEventChannel);
_SFXEventChannel.OnAudioCuePlayRequested -= PlayAudioCue;
_SFXEventChannel.OnAudioCueStopRequested -= StopAudioCue;
_SFXEventChannel.OnAudioCueFinishRequested -= FinishAudioCue;
_musicEventChannel.OnAudioCuePlayRequested -= PlayMusicTrack;
}
/// <summary>

}
}
private void RegisterChannel(AudioCueEventChannelSO audioCueEventChannel)
{
audioCueEventChannel.OnAudioCuePlayRequested += PlayAudioCue;
audioCueEventChannel.OnAudioCueStopRequested += StopAudioCue;
audioCueEventChannel.OnAudioCueFinishRequested += FinishAudioCue;
}
private void UnregisterChannel(AudioCueEventChannelSO audioCueEventChannel)
{
audioCueEventChannel.OnAudioCuePlayRequested -= PlayAudioCue;
audioCueEventChannel.OnAudioCueStopRequested -= StopAudioCue;
audioCueEventChannel.OnAudioCueFinishRequested -= FinishAudioCue;
}
// Both MixerValueNormalized and NormalizedToMixerValue functions are used for easier transformations
/// when using UI sliders normalized format
private float MixerValueToNormalized(float mixerValue)

// We're assuming the range [0 to 1] becomes [-80dB to 0dB]
// This doesn't allow values over 0dB
return (normalizedValue - 1f) * 80f;
}
private AudioCueKey PlayMusicTrack(AudioCueSO audioCue, AudioConfigurationSO audioConfiguration, Vector3 positionInSpace)
{
AudioCueKey currentMusicTrack = default;
_soundEmitterList.Get(currentMusicTrack, out SoundEmitter[] sem);
sem[0].Stop();
return PlayAudioCue(audioCue, audioConfiguration, positionInSpace);
}
/// <summary>

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/AudioCueEventChannelSO.cs


public AudioCueStopAction OnAudioCueStopRequested;
public AudioCueFinishAction OnAudioCueFinishRequested;
public AudioCueKey RaisePlayEvent(AudioCueSO audioCue, AudioConfigurationSO audioConfiguration, Vector3 positionInSpace)
public AudioCueKey RaisePlayEvent(AudioCueSO audioCue, AudioConfigurationSO audioConfiguration, Vector3 positionInSpace = default)
{
AudioCueKey audioCueKey = AudioCueKey.Invalid;

3
UOP1_Project/Assets/Scripts/SceneManagement/ScriptableObjects/LocationSO.cs


public class LocationSO : GameSceneSO
{
public LocalizedString locationName;
public AudioClip musicTrack;
public int enemiesCount; //Example variable, will change later
public AudioCueSO musicTrack;
}

1
UOP1_Project/Assets/Settings/Audio/DefaultAudioMixer.mixer


m_SnapshotID: d2c2ea162004da549b54501f768d5652
m_FloatValues:
9271f6921315a7245b91413294248994: 0
55eed10a876d8ce468e0e8868531d4f0: -3.8468575
m_TransitionOverrides: {}
--- !u!244 &383433361790407199
AudioMixerEffectController:

2
UOP1_Project/Assets/WIP_Prefabs.meta


fileFormatVersion: 2
guid: d6c6d132cddf0a149b2cff1a82b75b00
guid: 10107dfb5ddb80a468280c076129861b
folderAsset: yes
DefaultImporter:
externalObjects: {}

2
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset


m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08e854ccd8588da4694c3ae040c10c5e, type: 3}
m_Name: SFX_Footsteps
m_Name: SFX_Footsteps_Grass
m_EditorClassIdentifier:
looping: 0
_audioClipGroups:

8
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX.meta


fileFormatVersion: 2
guid: 371f2c6a237217741901d8f570ab267f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

28
UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MusicPlayer : MonoBehaviour
{
[SerializeField] private VoidEventChannelSO _onSceneReady = default;
[SerializeField] private AudioCueEventChannelSO _playMusicOn = default;
[SerializeField] private LocationSO _thisSceneSO = default;
[SerializeField] private AudioConfigurationSO _audioConfig = default;
private void OnEnable()
{
_onSceneReady.OnEventRaised += PlayMusic;
}
private void OnDisable()
{
_onSceneReady.OnEventRaised -= PlayMusic;
}
private void PlayMusic()
{
_playMusicOn.RaisePlayEvent(_thisSceneSO.musicTrack, _audioConfig);
}
}

11
UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs.meta


fileFormatVersion: 2
guid: 6bac00fb906d5ce448625eccf4aa04ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

19
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Beach.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08e854ccd8588da4694c3ae040c10c5e, type: 3}
m_Name: Music_Beach
m_EditorClassIdentifier:
looping: 1
_audioClipGroups:
- sequenceMode: 2
audioClips:
- {fileID: 8300000, guid: 0d3b647e3c636ab40a6d9b48d8ffab35, type: 3}

19
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Glade.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08e854ccd8588da4694c3ae040c10c5e, type: 3}
m_Name: Music_Glade
m_EditorClassIdentifier:
looping: 1
_audioClipGroups:
- sequenceMode: 2
audioClips:
- {fileID: 8300000, guid: 9871c84304b51b24c9c545454c791b2f, type: 3}

8
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Glade.asset.meta


fileFormatVersion: 2
guid: cd79ec002dc5c1942b30e2903393be0d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

38
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Sand.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 08e854ccd8588da4694c3ae040c10c5e, type: 3}
m_Name: SFX_Footsteps_Sand
m_EditorClassIdentifier:
looping: 0
_audioClipGroups:
- sequenceMode: 1
audioClips:
- {fileID: 8300000, guid: 3138751e94eb3eb48bb0621f7bc04aa8, type: 3}
- {fileID: 8300000, guid: 04fccb341230d3d4fbbe8510e388837d, type: 3}
- {fileID: 8300000, guid: 7afa5ae56560b8e4288c7ac952c299eb, type: 3}
- {fileID: 8300000, guid: 9e2402b962465ad4e91c176043cf6ee9, type: 3}
- {fileID: 8300000, guid: 95f308f276ef0474a9e80da289e739f9, type: 3}
- {fileID: 8300000, guid: 885aee2ad03a6db4ba959ad4e6692d1e, type: 3}
- {fileID: 8300000, guid: eda36a17a30fdec43ad0af5aca334a19, type: 3}
- {fileID: 8300000, guid: 2d7ec603215066f4484e0ba054e64a72, type: 3}
- {fileID: 8300000, guid: c748ecc33051b2942b0b0b9162e26fcd, type: 3}
- {fileID: 8300000, guid: c16226563439d1541bad4526d7da063a, type: 3}
- {fileID: 8300000, guid: d32a609fbca3ae74ca2fe6756f774339, type: 3}
- {fileID: 8300000, guid: 7f63c711b9c721941b5c6484730b91e7, type: 3}
- {fileID: 8300000, guid: a4d1076260c9d8547b2d4cbebb8f2143, type: 3}
- {fileID: 8300000, guid: 7bf7e97c45e488148a7d3d0b7a292b10, type: 3}
- {fileID: 8300000, guid: 92931d592538db24a8b600fe17e0ab87, type: 3}
- {fileID: 8300000, guid: d065e8c4bd52a6849a2bb3648827bf90, type: 3}
- {fileID: 8300000, guid: 7252878c5f4affd40958cf6347fbc6c6, type: 3}
- {fileID: 8300000, guid: a1bd2fdc9873e7f4e9bd3b0fe730f0fa, type: 3}
- {fileID: 8300000, guid: 89a063162ec0f064a81397c3192140b8, type: 3}
- {fileID: 8300000, guid: 65b8763d9bd257244800ae763bd95fb4, type: 3}

8
UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Sand.asset.meta


fileFormatVersion: 2
guid: 412141fe54999534a8d2800c2a567b55
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/2DSFX_Config.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/2DSFX_Config.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioConfigurations/UISFX_Config.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Tests.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music.meta

/UOP1_Project/Assets/Prefabs/Items/Salad.prefab → /UOP1_Project/Assets/WIP_Prefabs/Salad.prefab

/UOP1_Project/Assets/Prefabs/Items/Salad.prefab.meta → /UOP1_Project/Assets/WIP_Prefabs/Salad.prefab.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Fire_looping.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Fire_looping.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Fire_looping.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Fire_looping.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Footsteps.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Footsteps.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Footsteps_Grass.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Jump.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Jump.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_PickUp.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_PickUp.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_SwingCane.asset → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_SwingCane.asset

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_SwingCane.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_SwingCane.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_PickUp.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_PickUp.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX_Jump.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/SFX/SFX_Jump.asset.meta

/UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Tests/Music_8Bit.asset.meta → /UOP1_Project/Assets/ScriptableObjects/Audio/AudioCues/Music/Music_Beach.asset.meta

正在加载...
取消
保存