feat: Apply an audio effect to every manageable audio on a gameobject
A new AudioManager Method triggers a signal which is received by every ManageableAudio instance. If the causer of the signal is the same transform as the parent of the ManageableAudio, a change in AudioEffects is caused.
This commit is contained in:
parent
e444ebf950
commit
6dc42a05cc
@ -11,6 +11,7 @@ GameObject:
|
|||||||
- component: {fileID: 6423719894035945655}
|
- component: {fileID: 6423719894035945655}
|
||||||
- component: {fileID: 3310727599597512245}
|
- component: {fileID: 3310727599597512245}
|
||||||
- component: {fileID: 7696877450501702533}
|
- component: {fileID: 7696877450501702533}
|
||||||
|
- component: {fileID: 6827936618995316794}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Boost Sound 1
|
m_Name: Boost Sound 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -61,7 +62,7 @@ AudioSource:
|
|||||||
OutputAudioMixerGroup: {fileID: 0}
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
m_audioClip: {fileID: 8300000, guid: d6edf602b3baa0741bd59cce098f05d5, type: 3}
|
m_audioClip: {fileID: 8300000, guid: d6edf602b3baa0741bd59cce098f05d5, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 0.09
|
m_Volume: 0.07
|
||||||
m_Pitch: 0.9
|
m_Pitch: 0.9
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
@ -145,3 +146,28 @@ AudioSource:
|
|||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!169 &6827936618995316794
|
||||||
|
AudioLowPassFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_LowpassResonanceQ: 1
|
||||||
|
lowpassLevelCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.06775807
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
|||||||
@ -11,6 +11,7 @@ GameObject:
|
|||||||
- component: {fileID: 6423719894035945655}
|
- component: {fileID: 6423719894035945655}
|
||||||
- component: {fileID: 3310727599597512245}
|
- component: {fileID: 3310727599597512245}
|
||||||
- component: {fileID: 7696877450501702533}
|
- component: {fileID: 7696877450501702533}
|
||||||
|
- component: {fileID: 4941378086240168845}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Critical Tackle 1
|
m_Name: Critical Tackle 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -62,7 +63,7 @@ AudioSource:
|
|||||||
m_audioClip: {fileID: 8300000, guid: 029b2e37eed317c49841bf21a7a69233, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 029b2e37eed317c49841bf21a7a69233, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 0.2
|
m_Volume: 0.2
|
||||||
m_Pitch: 1
|
m_Pitch: 1.2
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
Spatialize: 0
|
Spatialize: 0
|
||||||
@ -145,3 +146,28 @@ AudioSource:
|
|||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!169 &4941378086240168845
|
||||||
|
AudioLowPassFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_LowpassResonanceQ: 1
|
||||||
|
lowpassLevelCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.13597089
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
|||||||
@ -47,6 +47,8 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
id: 1
|
id: 1
|
||||||
audioTag: main_menu_music
|
audioTag: main_menu_music
|
||||||
|
pitchRange: 0.3
|
||||||
|
volumeRange: 0.3
|
||||||
--- !u!82 &7696877450501702533
|
--- !u!82 &7696877450501702533
|
||||||
AudioSource:
|
AudioSource:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -60,7 +62,7 @@ AudioSource:
|
|||||||
m_audioClip: {fileID: 8300000, guid: f03afcd094e19824e8549f6fec3655ef, type: 3}
|
m_audioClip: {fileID: 8300000, guid: f03afcd094e19824e8549f6fec3655ef, type: 3}
|
||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 0.092
|
m_Volume: 0.092
|
||||||
m_Pitch: 0.95
|
m_Pitch: 1.13
|
||||||
Loop: 0
|
Loop: 0
|
||||||
Mute: 0
|
Mute: 0
|
||||||
Spatialize: 0
|
Spatialize: 0
|
||||||
|
|||||||
@ -11,6 +11,7 @@ GameObject:
|
|||||||
- component: {fileID: 6423719894035945655}
|
- component: {fileID: 6423719894035945655}
|
||||||
- component: {fileID: 3310727599597512245}
|
- component: {fileID: 3310727599597512245}
|
||||||
- component: {fileID: 7696877450501702533}
|
- component: {fileID: 7696877450501702533}
|
||||||
|
- component: {fileID: 6298175476027011211}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Normal Tackle 1
|
m_Name: Normal Tackle 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -145,3 +146,28 @@ AudioSource:
|
|||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!169 &6298175476027011211
|
||||||
|
AudioLowPassFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_LowpassResonanceQ: 1
|
||||||
|
lowpassLevelCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.13597089
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
|||||||
@ -11,6 +11,7 @@ GameObject:
|
|||||||
- component: {fileID: 6423719894035945655}
|
- component: {fileID: 6423719894035945655}
|
||||||
- component: {fileID: 3310727599597512245}
|
- component: {fileID: 3310727599597512245}
|
||||||
- component: {fileID: 7696877450501702533}
|
- component: {fileID: 7696877450501702533}
|
||||||
|
- component: {fileID: 7797534259601864668}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Thruster Sound 1
|
m_Name: Thruster Sound 1
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -47,7 +48,7 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
id: 1
|
id: 1
|
||||||
audioTag: thruster
|
audioTag: thruster
|
||||||
pitchRange: 0.4
|
pitchRange: 0.5
|
||||||
volumeRange: 0.3
|
volumeRange: 0.3
|
||||||
--- !u!82 &7696877450501702533
|
--- !u!82 &7696877450501702533
|
||||||
AudioSource:
|
AudioSource:
|
||||||
@ -63,7 +64,7 @@ AudioSource:
|
|||||||
m_PlayOnAwake: 0
|
m_PlayOnAwake: 0
|
||||||
m_Volume: 0.08
|
m_Volume: 0.08
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 0
|
Loop: 1
|
||||||
Mute: 0
|
Mute: 0
|
||||||
Spatialize: 0
|
Spatialize: 0
|
||||||
SpatializePostEffects: 0
|
SpatializePostEffects: 0
|
||||||
@ -145,3 +146,28 @@ AudioSource:
|
|||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!169 &7797534259601864668
|
||||||
|
AudioLowPassFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 0
|
||||||
|
serializedVersion: 3
|
||||||
|
m_LowpassResonanceQ: 1
|
||||||
|
lowpassLevelCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0.045020465
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
|||||||
147
Assets/Prefabs/Audio/Zone Change In.prefab
Normal file
147
Assets/Prefabs/Audio/Zone Change In.prefab
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &4479628772504131522
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6423719894035945655}
|
||||||
|
- component: {fileID: 3310727599597512245}
|
||||||
|
- component: {fileID: 7696877450501702533}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Zone Change In
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6423719894035945655
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
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: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3310727599597512245
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 887650ff1f3850a43aa8d1281fc70528, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
id: 1
|
||||||
|
audioTag: thruster
|
||||||
|
pitchRange: 0.4
|
||||||
|
volumeRange: 0.3
|
||||||
|
--- !u!82 &7696877450501702533
|
||||||
|
AudioSource:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 4
|
||||||
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
|
m_audioClip: {fileID: 8300000, guid: 025361f5b3f97a445ad89bc9ac61c30b, type: 3}
|
||||||
|
m_PlayOnAwake: 0
|
||||||
|
m_Volume: 0.08
|
||||||
|
m_Pitch: 1
|
||||||
|
Loop: 0
|
||||||
|
Mute: 0
|
||||||
|
Spatialize: 0
|
||||||
|
SpatializePostEffects: 0
|
||||||
|
Priority: 128
|
||||||
|
DopplerLevel: 0
|
||||||
|
MinDistance: 1
|
||||||
|
MaxDistance: 100
|
||||||
|
Pan2D: 0
|
||||||
|
rolloffMode: 1
|
||||||
|
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: 1
|
||||||
|
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: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
7
Assets/Prefabs/Audio/Zone Change In.prefab.meta
Normal file
7
Assets/Prefabs/Audio/Zone Change In.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 28db476bf8ba56c4bacea4ad2070bcad
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
147
Assets/Prefabs/Audio/Zone Change Out.prefab
Normal file
147
Assets/Prefabs/Audio/Zone Change Out.prefab
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &4479628772504131522
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6423719894035945655}
|
||||||
|
- component: {fileID: 3310727599597512245}
|
||||||
|
- component: {fileID: 7696877450501702533}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Zone Change Out
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6423719894035945655
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
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: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3310727599597512245
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 887650ff1f3850a43aa8d1281fc70528, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
id: 1
|
||||||
|
audioTag: thruster
|
||||||
|
pitchRange: 0.4
|
||||||
|
volumeRange: 0.3
|
||||||
|
--- !u!82 &7696877450501702533
|
||||||
|
AudioSource:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 4479628772504131522}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 4
|
||||||
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
|
m_audioClip: {fileID: 8300000, guid: 025361f5b3f97a445ad89bc9ac61c30b, type: 3}
|
||||||
|
m_PlayOnAwake: 0
|
||||||
|
m_Volume: 0.08
|
||||||
|
m_Pitch: 1
|
||||||
|
Loop: 0
|
||||||
|
Mute: 0
|
||||||
|
Spatialize: 0
|
||||||
|
SpatializePostEffects: 0
|
||||||
|
Priority: 128
|
||||||
|
DopplerLevel: 0
|
||||||
|
MinDistance: 1
|
||||||
|
MaxDistance: 100
|
||||||
|
Pan2D: 0
|
||||||
|
rolloffMode: 1
|
||||||
|
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: 1
|
||||||
|
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: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
7
Assets/Prefabs/Audio/Zone Change Out.prefab.meta
Normal file
7
Assets/Prefabs/Audio/Zone Change Out.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f35afa6dbb3e6d346a9fa1d98032d910
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -1,12 +1,19 @@
|
|||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using Managers;
|
||||||
using PrimeTween;
|
using PrimeTween;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum AudioEffects
|
||||||
|
{
|
||||||
|
LowPass
|
||||||
|
}
|
||||||
|
|
||||||
public class ManageableAudio : MonoBehaviour
|
public class ManageableAudio : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
@ -39,6 +46,11 @@ public class ManageableAudio : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
AudioManager.G.AudioEffectBroadcasted += SwitchAudioEffect;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start playing the sound source.
|
/// Start playing the sound source.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -131,4 +143,31 @@ public class ManageableAudio : MonoBehaviour
|
|||||||
WasOneShotTriggered = false;
|
WasOneShotTriggered = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SwitchAudioEffect(AudioEffectBroadCastEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.AffectedParent != transform.parent)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (args.Effect)
|
||||||
|
{
|
||||||
|
case AudioEffects.LowPass:
|
||||||
|
SwitchLowPassFilter(args.Activate);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SwitchLowPassFilter(bool activate)
|
||||||
|
{
|
||||||
|
if (TryGetComponent(out AudioLowPassFilter filter))
|
||||||
|
{
|
||||||
|
filter.enabled = activate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
AudioManager.G.AudioEffectBroadcasted -= SwitchAudioEffect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,9 @@ namespace Managers
|
|||||||
private Dictionary<ManageableAudio, GameObject> audioDictionary =
|
private Dictionary<ManageableAudio, GameObject> audioDictionary =
|
||||||
new Dictionary<ManageableAudio, GameObject>();
|
new Dictionary<ManageableAudio, GameObject>();
|
||||||
|
|
||||||
|
public delegate void OnAudioEffectBroadcast(AudioEffectBroadCastEventArgs args);
|
||||||
|
public event OnAudioEffectBroadcast AudioEffectBroadcasted;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
@ -197,6 +200,22 @@ namespace Managers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BroadcastAudioEffect(AudioEffects effect, Transform t, bool activate)
|
||||||
|
{
|
||||||
|
AudioEffectBroadcasted.Invoke(new AudioEffectBroadCastEventArgs
|
||||||
|
{
|
||||||
|
AffectedParent = t,
|
||||||
|
Effect = effect,
|
||||||
|
Activate = activate
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public class AudioEffectBroadCastEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public Transform AffectedParent { get; set; }
|
||||||
|
public AudioEffects Effect { get; set; }
|
||||||
|
public bool Activate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -9,6 +9,40 @@ using UnityEngine;
|
|||||||
using GameLogic;
|
using GameLogic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// States the match can be in.
|
||||||
|
/// </summary>
|
||||||
|
public enum MatchState
|
||||||
|
{
|
||||||
|
CharacterSelect,
|
||||||
|
Pause,
|
||||||
|
Starting,
|
||||||
|
Match,
|
||||||
|
End
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update data relevant to this matches rules.
|
||||||
|
/// </summary>
|
||||||
|
public class MatchConditionUpdate
|
||||||
|
{
|
||||||
|
public WinCondition Condition { get; set; }
|
||||||
|
public Ship Ship { get; set; }
|
||||||
|
public int Count { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The properties a player is assigned at the start
|
||||||
|
/// of the match, according to the rules.
|
||||||
|
/// </summary>
|
||||||
|
public class MatchPlayerStatistic
|
||||||
|
{
|
||||||
|
public bool IsOut { get; set; }
|
||||||
|
public int Lives { get; set; }
|
||||||
|
public int Score { get; set; }
|
||||||
|
public int Time { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
namespace Managers
|
namespace Managers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -79,24 +113,24 @@ namespace Managers
|
|||||||
Player updatedPlayer = null;
|
Player updatedPlayer = null;
|
||||||
foreach (Player p in matchPlayers)
|
foreach (Player p in matchPlayers)
|
||||||
{
|
{
|
||||||
if (p.character.shipName == update.ship.props.shipName)
|
if (p.character.shipName == update.Ship.props.shipName)
|
||||||
{
|
{
|
||||||
updatedPlayer = p;
|
updatedPlayer = p;
|
||||||
Log.Debug($"Players: {p.name} match statistic will be updated.");
|
Log.Debug($"Players: {p.name} match statistic will be updated.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: Match Result should contain progression over multiple rounds.
|
// TODO: Match Result should contain progression over multiple rounds.
|
||||||
MatchResult mr = MatchLogic.UpdateMatchResult(updatedPlayer, update, matchPlayerStatistics);
|
MatchResult result = MatchLogic.UpdateMatchResult(updatedPlayer, update, matchPlayerStatistics);
|
||||||
if (updatedPlayer != null && mr != null)
|
if (updatedPlayer != null && result != null)
|
||||||
{
|
{
|
||||||
matchState = MatchState.End;
|
matchState = MatchState.End;
|
||||||
Log.Info("Match has ended, winner will be declared.");
|
Log.Info("Match has ended, winner will be declared.");
|
||||||
// TODO: Take player decisions into account before restarting the match
|
// TODO: Take player decisions into account before restarting the match
|
||||||
// TODO: Include the statistics and match round progression in announcements
|
// TODO: Include the statistics and match round progression in announcements
|
||||||
AnnounceWinner(mr);
|
AnnounceWinner(result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.Error($"Ship: {update.ship.props.shipName} does not belong to a player in this match."
|
Log.Error($"Ship: {update.Ship.props.shipName} does not belong to a player in this match."
|
||||||
+ " Can't update match.");
|
+ " Can't update match.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,37 +361,3 @@ namespace Managers
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// States the match can be in.
|
|
||||||
/// </summary>
|
|
||||||
public enum MatchState
|
|
||||||
{
|
|
||||||
CharacterSelect,
|
|
||||||
Pause,
|
|
||||||
Starting,
|
|
||||||
Match,
|
|
||||||
End
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update data relevant to this matches rules.
|
|
||||||
/// </summary>
|
|
||||||
public class MatchConditionUpdate
|
|
||||||
{
|
|
||||||
public WinCondition Condition { get; set; }
|
|
||||||
public Ship ship { get; set; }
|
|
||||||
public int count { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The properties a player is assigned at the start
|
|
||||||
/// of the match, according to the rules.
|
|
||||||
/// </summary>
|
|
||||||
public class MatchPlayerStatistic
|
|
||||||
{
|
|
||||||
public bool IsOut { get; set; }
|
|
||||||
public int Lives { get; set; }
|
|
||||||
public int Score { get; set; }
|
|
||||||
public int Time { get; set; }
|
|
||||||
}
|
|
||||||
@ -24,13 +24,13 @@ namespace GameLogic
|
|||||||
switch (args.Condition)
|
switch (args.Condition)
|
||||||
{
|
{
|
||||||
case WinCondition.Lives:
|
case WinCondition.Lives:
|
||||||
UpdateLives(mps[p], args.count);
|
UpdateLives(mps[p], args.Count);
|
||||||
break;
|
break;
|
||||||
case WinCondition.Score:
|
case WinCondition.Score:
|
||||||
UpdateScore(mps[p], args.count);
|
UpdateScore(mps[p], args.Count);
|
||||||
break;
|
break;
|
||||||
case WinCondition.Time:
|
case WinCondition.Time:
|
||||||
UpdateTime(mps[p], args.count);
|
UpdateTime(mps[p], args.Count);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return DetectMatchResult(mps);
|
return DetectMatchResult(mps);
|
||||||
|
|||||||
@ -13,9 +13,11 @@ public class PlayingFieldDetection : MonoBehaviour
|
|||||||
/// <param name="collider"></param>
|
/// <param name="collider"></param>
|
||||||
private void OnTriggerExit(Collider collider)
|
private void OnTriggerExit(Collider collider)
|
||||||
{
|
{
|
||||||
|
// TODO: This depends on a collider leaving the field which has only one
|
||||||
|
// instance with the same tag on the ship object.
|
||||||
if (collider.tag == "Ship")
|
if (collider.tag == "Ship")
|
||||||
{
|
{
|
||||||
if (!collider.TryGetComponent(out Ship ship))
|
if (!collider.TryGetComponent(out Ship shipComponent))
|
||||||
{
|
{
|
||||||
Log.Error($"Collider: {collider} was tagged as Ship, but has no Ship component.");
|
Log.Error($"Collider: {collider} was tagged as Ship, but has no Ship component.");
|
||||||
return;
|
return;
|
||||||
@ -23,8 +25,8 @@ public class PlayingFieldDetection : MonoBehaviour
|
|||||||
MatchManager.G.UpdateMatchCondition(new MatchConditionUpdate
|
MatchManager.G.UpdateMatchCondition(new MatchConditionUpdate
|
||||||
{
|
{
|
||||||
Condition = WinCondition.Lives,
|
Condition = WinCondition.Lives,
|
||||||
ship = ship,
|
Ship = shipComponent,
|
||||||
count = -1
|
Count = -1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,10 +26,13 @@ public class Ship : MonoBehaviour
|
|||||||
private float tackledTime = 0f;
|
private float tackledTime = 0f;
|
||||||
// Current Zone the player occupies
|
// Current Zone the player occupies
|
||||||
private Zone zone = Zone.NimbleZone;
|
private Zone zone = Zone.NimbleZone;
|
||||||
|
// Upcoming zone change
|
||||||
|
private Zone newZone = Zone.NimbleZone;
|
||||||
|
|
||||||
private ManageableAudio ThrusterSound;
|
private ManageableAudio ThrusterSound;
|
||||||
private ManageableAudio BoosterSound;
|
private ManageableAudio BoosterSound;
|
||||||
private ManageableAudio ZoneChangeSound;
|
private ManageableAudio LeaveZoneSound;
|
||||||
|
private ManageableAudio EnterZoneSound;
|
||||||
private ManageableAudio TackleOpponentSound;
|
private ManageableAudio TackleOpponentSound;
|
||||||
private ManageableAudio CriticalTackleOpponentSound;
|
private ManageableAudio CriticalTackleOpponentSound;
|
||||||
private ManageableAudio BeingTackledSound;
|
private ManageableAudio BeingTackledSound;
|
||||||
@ -48,7 +51,8 @@ public class Ship : MonoBehaviour
|
|||||||
BoosterSound = AudioManager.G.GetLocalSound("booster", 1, gameObject.transform);
|
BoosterSound = AudioManager.G.GetLocalSound("booster", 1, gameObject.transform);
|
||||||
BeingTackledSound = AudioManager.G.GetLocalSound("normal_tackle", 1, gameObject.transform);
|
BeingTackledSound = AudioManager.G.GetLocalSound("normal_tackle", 1, gameObject.transform);
|
||||||
BeingCriticallyTackledSound = AudioManager.G.GetLocalSound("critical_tackle", 1, gameObject.transform);
|
BeingCriticallyTackledSound = AudioManager.G.GetLocalSound("critical_tackle", 1, gameObject.transform);
|
||||||
//ZoneChangeSound = AudioManager.G.GetLocalSound("thruster_sound", 1, gameObject.transform);
|
LeaveZoneSound = AudioManager.G.GetLocalSound("thruster_sound", 1, gameObject.transform);
|
||||||
|
EnterZoneSound = AudioManager.G.GetLocalSound("thruster_sound", 1, gameObject.transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
@ -94,12 +98,16 @@ public class Ship : MonoBehaviour
|
|||||||
}
|
}
|
||||||
body.constraints = RigidbodyConstraints.None;
|
body.constraints = RigidbodyConstraints.None;
|
||||||
// TODO: This belongs in the state object
|
// TODO: This belongs in the state object
|
||||||
zone = forceManager.GetZoneOfInstance(InstanceID);
|
newZone = forceManager.GetZoneOfInstance(InstanceID);
|
||||||
//BoostStateUpdate(Time.deltaTime);
|
//BoostStateUpdate(Time.deltaTime);
|
||||||
// Rotate the vehicle with the current steer velocity
|
// Rotate the vehicle with the current steer velocity
|
||||||
// Calculate the magnitude of the acceleration with the current thrust
|
// Calculate the magnitude of the acceleration with the current thrust
|
||||||
UpdateMovement();
|
|
||||||
UpdateSounds();
|
UpdateSounds();
|
||||||
|
if (zone != newZone)
|
||||||
|
{
|
||||||
|
zone = newZone;
|
||||||
|
}
|
||||||
|
UpdateMovement();
|
||||||
BoostStateUpdate(Time.deltaTime);
|
BoostStateUpdate(Time.deltaTime);
|
||||||
UpdateTackleResponse(isCriticalTackle);
|
UpdateTackleResponse(isCriticalTackle);
|
||||||
}
|
}
|
||||||
@ -372,6 +380,19 @@ public class Ship : MonoBehaviour
|
|||||||
BeingCriticallyTackledSound.ResetOneShot();
|
BeingCriticallyTackledSound.ResetOneShot();
|
||||||
BeingTackledSound.ResetOneShot();
|
BeingTackledSound.ResetOneShot();
|
||||||
}
|
}
|
||||||
|
if (newZone != zone)
|
||||||
|
{
|
||||||
|
if (newZone != Zone.NimbleZone)
|
||||||
|
{
|
||||||
|
//LeaveZoneSound?.PlayAudio(false);
|
||||||
|
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//EnterZoneSound?.PlayAudio(false);
|
||||||
|
AudioManager.G.BroadcastAudioEffect(AudioEffects.LowPass, transform, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user