basic fire sound. very loud
This commit is contained in:
parent
819741ba6a
commit
95603a9a12
5 changed files with 188 additions and 0 deletions
BIN
Assets/_Project/Audio/tesla_tower.ogg
(Stored with Git LFS)
Normal file
BIN
Assets/_Project/Audio/tesla_tower.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
23
Assets/_Project/Audio/tesla_tower.ogg.meta
Normal file
23
Assets/_Project/Audio/tesla_tower.ogg.meta
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ac71e042fc717a9c496b76afa7803ddf
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 8
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -99,6 +99,8 @@ GameObject:
|
|||
- component: {fileID: 805962841523123163}
|
||||
- component: {fileID: 8853488620519990682}
|
||||
- component: {fileID: 4524938955752569428}
|
||||
- component: {fileID: 42814861218671054}
|
||||
- component: {fileID: -2590971686077483651}
|
||||
m_Layer: 0
|
||||
m_Name: Tower_TeslaCoil
|
||||
m_TagString: Untagged
|
||||
|
|
@ -222,6 +224,116 @@ MonoBehaviour:
|
|||
arcDuration: 0.12
|
||||
segmentsPerArc: 6
|
||||
jitter: 0.2
|
||||
--- !u!82 &42814861218671054
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6482414459531823157}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_Resource: {fileID: 0}
|
||||
m_PlayOnAwake: 0
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!114 &-2590971686077483651
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6482414459531823157}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: db643146344a08a639133638e4746a33, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::TD.Combat.TeslaTowerFireSound
|
||||
fireClip: {fileID: 8300000, guid: ac71e042fc717a9c496b76afa7803ddf, type: 3}
|
||||
--- !u!1 &7101790219931971190
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
48
Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
Normal file
48
Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
|
||||
using UnityEngine;
|
||||
|
||||
namespace TD.Combat
|
||||
{
|
||||
/// <summary>
|
||||
/// Local-only audio for the Tesla Coil tower. Subscribes to
|
||||
/// <see cref="TowerCombat.OnAreaFired"/> and plays a one-shot fire sound
|
||||
/// on every peer each time the coil discharges.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Pure client-side — nothing here is networked. Add additional
|
||||
/// <see cref="AudioClip"/> fields and <see cref="AudioSource"/> calls here
|
||||
/// as the Tesla Coil gains more audio (idle hum, charge-up, etc.).
|
||||
/// </remarks>
|
||||
[RequireComponent(typeof(TowerCombat))]
|
||||
[RequireComponent(typeof(AudioSource))]
|
||||
public class TeslaTowerFireSound : MonoBehaviour
|
||||
{
|
||||
[Tooltip("Sound played each time the coil discharges.")]
|
||||
[SerializeField] private AudioClip fireClip;
|
||||
|
||||
private TowerCombat combat;
|
||||
private AudioSource audioSource;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
combat = GetComponent<TowerCombat>();
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (combat != null) combat.OnAreaFired += HandleAreaFired;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (combat != null) combat.OnAreaFired -= HandleAreaFired;
|
||||
}
|
||||
|
||||
private void HandleAreaFired(Vector3[] positions)
|
||||
{
|
||||
if (fireClip != null)
|
||||
audioSource.PlayOneShot(fireClip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: db643146344a08a639133638e4746a33
|
||||
Loading…
Add table
Add a link
Reference in a new issue