diff --git a/Assets/_Project/Audio/buildings.meta b/Assets/_Project/Audio/buildings.meta
new file mode 100644
index 0000000..1c49c38
--- /dev/null
+++ b/Assets/_Project/Audio/buildings.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9922143d68d6063e4a08cdeeb509237c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/_Project/Audio/buildings/tesla_tower.meta b/Assets/_Project/Audio/buildings/tesla_tower.meta
new file mode 100644
index 0000000..b57c8e0
--- /dev/null
+++ b/Assets/_Project/Audio/buildings/tesla_tower.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 010b1a2adea9686f09d4ab14690eb26b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav b/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav
new file mode 100644
index 0000000..38f8a15
--- /dev/null
+++ b/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4bfa0b438971751b46fa605e5aacd28006e7518498c540c626708ccbe3a1bfb
+size 787646
diff --git a/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav.meta b/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav.meta
new file mode 100644
index 0000000..aaa6ef2
--- /dev/null
+++ b/Assets/_Project/Audio/buildings/tesla_tower/construction_finished.wav.meta
@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: 6ff2e0ba45ef5eb6abeb34bd2c6e2da8
+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:
diff --git a/Assets/_Project/Audio/tesla_tower.ogg b/Assets/_Project/Audio/buildings/tesla_tower/tesla_tower.ogg
similarity index 100%
rename from Assets/_Project/Audio/tesla_tower.ogg
rename to Assets/_Project/Audio/buildings/tesla_tower/tesla_tower.ogg
diff --git a/Assets/_Project/Audio/tesla_tower.ogg.meta b/Assets/_Project/Audio/buildings/tesla_tower/tesla_tower.ogg.meta
similarity index 100%
rename from Assets/_Project/Audio/tesla_tower.ogg.meta
rename to Assets/_Project/Audio/buildings/tesla_tower/tesla_tower.ogg.meta
diff --git a/Assets/_Project/Audio/death_sounds.meta b/Assets/_Project/Audio/death_sounds.meta
new file mode 100644
index 0000000..5759991
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0a6f35a8a0b1666d8aeebf2071d63132
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/_Project/Audio/death_sounds/cyclops.meta b/Assets/_Project/Audio/death_sounds/cyclops.meta
new file mode 100644
index 0000000..0ab0edd
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds/cyclops.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 00e7929e355a29031b42d55d7637e784
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav
new file mode 100755
index 0000000..50fb46a
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e05eb8e8852d8425e8e615aa9183bef154ba978187f717d8dcced14d73725b56
+size 524990
diff --git a/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav.meta b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav.meta
new file mode 100644
index 0000000..573d4c5
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_1.wav.meta
@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: e007e19b827137ce395021d825927dcc
+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:
diff --git a/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav
new file mode 100755
index 0000000..e8f0ac6
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:862dd7c3d4bfa81198162f9473a07060ece551a42a52f2ef91be05c3d89b3090
+size 262334
diff --git a/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav.meta b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav.meta
new file mode 100644
index 0000000..eb82461
--- /dev/null
+++ b/Assets/_Project/Audio/death_sounds/cyclops/cyclops_death_sound_2.wav.meta
@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: 6cea30689732db2f0a8989fe8f1a07a9
+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:
diff --git a/Assets/_Project/Prefabs/Enemies/Enemy_CrystalGolem_Blue.prefab b/Assets/_Project/Prefabs/Enemies/Enemy_CrystalGolem_Blue.prefab
index 6bf2444..546fd71 100644
--- a/Assets/_Project/Prefabs/Enemies/Enemy_CrystalGolem_Blue.prefab
+++ b/Assets/_Project/Prefabs/Enemies/Enemy_CrystalGolem_Blue.prefab
@@ -16,6 +16,7 @@ GameObject:
- component: {fileID: 3283904430289710888}
- component: {fileID: 3756613737869398948}
- component: {fileID: 6036713598566100742}
+ - component: {fileID: -1575784752119152190}
m_Layer: 10
m_Name: Enemy_CrystalGolem_Blue
m_TagString: Untagged
@@ -202,6 +203,27 @@ CapsuleCollider:
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 1, z: 0}
+--- !u!114 &-1575784752119152190
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1455822126534880203}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 9df6fea9a86daafae998f8eecc44ee7d, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::TD.Combat.EnemyDeathSound
+ deathSounds:
+ - clip: {fileID: 8300000, guid: e007e19b827137ce395021d825927dcc, type: 3}
+ volume: 0.75
+ minPitch: 0.95
+ maxPitch: 1.05
+ - clip: {fileID: 8300000, guid: 6cea30689732db2f0a8989fe8f1a07a9, type: 3}
+ volume: 0.75
+ minPitch: 0.95
+ maxPitch: 1.05
--- !u!1 &5361867751622119598
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/_Project/Prefabs/Enemies/Enemy_Cyclops_Green.prefab b/Assets/_Project/Prefabs/Enemies/Enemy_Cyclops_Green.prefab
index fad5f6b..dfb934a 100644
--- a/Assets/_Project/Prefabs/Enemies/Enemy_Cyclops_Green.prefab
+++ b/Assets/_Project/Prefabs/Enemies/Enemy_Cyclops_Green.prefab
@@ -16,6 +16,7 @@ GameObject:
- component: {fileID: 3283904430289710888}
- component: {fileID: 3756613737869398948}
- component: {fileID: 6036713598566100742}
+ - component: {fileID: -4695266156693656620}
m_Layer: 10
m_Name: Enemy_Cyclops_Green
m_TagString: Untagged
@@ -202,6 +203,21 @@ CapsuleCollider:
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 1, z: 0}
+--- !u!114 &-4695266156693656620
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1455822126534880203}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 9df6fea9a86daafae998f8eecc44ee7d, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::TD.Combat.EnemyDeathSound
+ deathClips:
+ - {fileID: 8300000, guid: e007e19b827137ce395021d825927dcc, type: 3}
+ - {fileID: 8300000, guid: 6cea30689732db2f0a8989fe8f1a07a9, type: 3}
--- !u!1 &5361867751622119598
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/_Project/Prefabs/Towers/Tower_TeslaCoil.prefab b/Assets/_Project/Prefabs/Towers/Tower_TeslaCoil.prefab
index cff0c5b..ede5f43 100644
--- a/Assets/_Project/Prefabs/Towers/Tower_TeslaCoil.prefab
+++ b/Assets/_Project/Prefabs/Towers/Tower_TeslaCoil.prefab
@@ -100,6 +100,7 @@ GameObject:
- component: {fileID: 8853488620519990682}
- component: {fileID: 4524938955752569428}
- component: {fileID: -2590971686077483651}
+ - component: {fileID: 1288485127287735786}
m_Layer: 0
m_Name: Tower_TeslaCoil
m_TagString: Untagged
@@ -146,7 +147,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
- GlobalObjectIdHash: 1363936954
+ GlobalObjectIdHash: 280718094
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
@@ -219,10 +220,20 @@ MonoBehaviour:
emitter: {fileID: 1088221722203278382}
arcMaterial: {fileID: 2100000, guid: 9ba610475fb3d4c4fa1245e15a72aee5, type: 2}
arcColor: {r: 0.6, g: 0.85, b: 1, a: 1}
+ emissionIntensity: 4
arcWidth: 0.06
arcDuration: 0.12
segmentsPerArc: 6
+ arcHeight: 0.18
jitter: 0.2
+ castLight: 1
+ lightColor: {r: 0.6, g: 0.85, b: 1, a: 1}
+ lightIntensity: 8
+ lightRange: 12
+ castImpactLight: 1
+ impactLightIntensity: 4
+ impactLightRange: 5
+ maxImpactLights: 8
--- !u!114 &-2590971686077483651
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -235,9 +246,28 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: db643146344a08a639133638e4746a33, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::TD.Combat.TeslaTowerFireSound
- fireClip: {fileID: 8300000, guid: a0b5d0b15de667604b825f12d39b05a8, type: 3}
- minPitch: 0.92
- maxPitch: 1.07
+ fireSound:
+ clip: {fileID: 8300000, guid: a0b5d0b15de667604b825f12d39b05a8, type: 3}
+ volume: 0.263
+ minPitch: 0.95
+ maxPitch: 1.05
+--- !u!114 &1288485127287735786
+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: ce512ec39eb6a8f079c7b258a4d0ced1, type: 3}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp::TD.Combat.TowerBuiltSound
+ builtSound:
+ clip: {fileID: 8300000, guid: 6ff2e0ba45ef5eb6abeb34bd2c6e2da8, type: 3}
+ volume: 0.496
+ minPitch: 1
+ maxPitch: 1
--- !u!1 &7101790219931971190
GameObject:
m_ObjectHideFlags: 0
diff --git a/Assets/_Project/Scripts/Audio/AudioManager.cs b/Assets/_Project/Scripts/Audio/AudioManager.cs
index 961a820..21099bb 100644
--- a/Assets/_Project/Scripts/Audio/AudioManager.cs
+++ b/Assets/_Project/Scripts/Audio/AudioManager.cs
@@ -58,7 +58,7 @@ namespace TD.Audio
}
}
- public void Play(AudioClip clip, AudioCategory category, float pitch = 1f)
+ public void Play(AudioClip clip, AudioCategory category, float pitch = 1f, float volume = 1f)
{
if (clip == null) return;
if (!pools.TryGetValue(category, out var pool)) return;
@@ -66,6 +66,7 @@ namespace TD.Audio
int idx = indices[category];
var src = pool[idx % pool.Length];
src.pitch = pitch;
+ src.volume = volume;
src.clip = clip;
src.Play();
indices[category] = idx + 1;
diff --git a/Assets/_Project/Scripts/Audio/SoundConfig.cs b/Assets/_Project/Scripts/Audio/SoundConfig.cs
new file mode 100644
index 0000000..d1be3e2
--- /dev/null
+++ b/Assets/_Project/Scripts/Audio/SoundConfig.cs
@@ -0,0 +1,16 @@
+// Assets/_Project/Scripts/Audio/SoundConfig.cs
+using UnityEngine;
+
+namespace TD.Audio
+{
+ [System.Serializable]
+ public struct SoundConfig
+ {
+ public AudioClip clip;
+ [Range(0f, 1f)] public float volume;
+ [Range(0f, 3f)] public float minPitch;
+ [Range(0f, 3f)] public float maxPitch;
+
+ public float RandomPitch() => Random.Range(minPitch, maxPitch);
+ }
+}
diff --git a/Assets/_Project/Scripts/Audio/SoundConfig.cs.meta b/Assets/_Project/Scripts/Audio/SoundConfig.cs.meta
new file mode 100644
index 0000000..df0ac08
--- /dev/null
+++ b/Assets/_Project/Scripts/Audio/SoundConfig.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: fce44aba7ccbe4224aeae2faa74b978f
\ No newline at end of file
diff --git a/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs b/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs
new file mode 100644
index 0000000..cc1c503
--- /dev/null
+++ b/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs
@@ -0,0 +1,42 @@
+// Assets/_Project/Scripts/Combat/EnemyDeathSound.cs
+using TD.Audio;
+using TD.Gameplay;
+using UnityEngine;
+
+namespace TD.Combat
+{
+ ///
+ /// Local-only audio for enemy death. Subscribes to
+ /// and plays a randomly chosen clip from .
+ /// Attach to any enemy prefab and assign its clips in the Inspector.
+ ///
+ [RequireComponent(typeof(EnemyHealth))]
+ public class EnemyDeathSound : MonoBehaviour
+ {
+ [SerializeField] private SoundConfig[] deathSounds;
+
+ private EnemyHealth enemyHealth;
+
+ private void Awake()
+ {
+ enemyHealth = GetComponent();
+ }
+
+ private void OnEnable()
+ {
+ if (enemyHealth != null) enemyHealth.OnDiedClient += HandleDied;
+ }
+
+ private void OnDisable()
+ {
+ if (enemyHealth != null) enemyHealth.OnDiedClient -= HandleDied;
+ }
+
+ private void HandleDied()
+ {
+ if (deathSounds == null || deathSounds.Length == 0) return;
+ var sound = deathSounds[Random.Range(0, deathSounds.Length)];
+ AudioManager.Instance?.Play(sound.clip, AudioCategory.EnemyHitDeath, sound.RandomPitch(), sound.volume);
+ }
+ }
+}
diff --git a/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs.meta b/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs.meta
new file mode 100644
index 0000000..f68c450
--- /dev/null
+++ b/Assets/_Project/Scripts/Combat/EnemyDeathSound.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 9df6fea9a86daafae998f8eecc44ee7d
\ No newline at end of file
diff --git a/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs b/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
index 9294b85..3334523 100644
--- a/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
+++ b/Assets/_Project/Scripts/Combat/TeslaTowerFireSound.cs
@@ -17,12 +17,7 @@ namespace TD.Combat
[RequireComponent(typeof(TowerCombat))]
public class TeslaTowerFireSound : MonoBehaviour
{
- [Tooltip("Sound played each time the coil discharges.")]
- [SerializeField] private AudioClip fireClip;
-
- [Tooltip("Pitch is randomized within this range each shot to avoid a mechanical loop.")]
- [SerializeField] private float minPitch = 0.93f;
- [SerializeField] private float maxPitch = 1.07f;
+ [SerializeField] private SoundConfig fireSound;
private TowerCombat combat;
@@ -43,7 +38,7 @@ namespace TD.Combat
private void HandleAreaFired(Vector3[] positions)
{
- AudioManager.Instance?.Play(fireClip, AudioCategory.TowerFire, Random.Range(minPitch, maxPitch));
+ AudioManager.Instance?.Play(fireSound.clip, AudioCategory.TowerFire, fireSound.RandomPitch(), fireSound.volume);
}
}
}
diff --git a/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs b/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs
new file mode 100644
index 0000000..30f3376
--- /dev/null
+++ b/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs
@@ -0,0 +1,41 @@
+// Assets/_Project/Scripts/Combat/TowerBuiltSound.cs
+using TD.Audio;
+using TD.Gameplay;
+using UnityEngine;
+
+namespace TD.Combat
+{
+ ///
+ /// Local-only audio for tower construction completion. Subscribes to
+ /// and plays a sound on every peer
+ /// when the tower finishes building.
+ /// Attach to any tower prefab and assign its clip in the Inspector.
+ ///
+ [RequireComponent(typeof(TowerInstance))]
+ public class TowerBuiltSound : MonoBehaviour
+ {
+ [SerializeField] private SoundConfig builtSound;
+
+ private TowerInstance towerInstance;
+
+ private void Awake()
+ {
+ towerInstance = GetComponent();
+ }
+
+ private void OnEnable()
+ {
+ if (towerInstance != null) towerInstance.OnBuiltClient += HandleBuilt;
+ }
+
+ private void OnDisable()
+ {
+ if (towerInstance != null) towerInstance.OnBuiltClient -= HandleBuilt;
+ }
+
+ private void HandleBuilt()
+ {
+ AudioManager.Instance?.Play(builtSound.clip, AudioCategory.UI, builtSound.RandomPitch(), builtSound.volume);
+ }
+ }
+}
diff --git a/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs.meta b/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs.meta
new file mode 100644
index 0000000..5aa4685
--- /dev/null
+++ b/Assets/_Project/Scripts/Combat/TowerBuiltSound.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: ce512ec39eb6a8f079c7b258a4d0ced1
\ No newline at end of file
diff --git a/Assets/_Project/Scripts/Gameplay/EnemyHealth.cs b/Assets/_Project/Scripts/Gameplay/EnemyHealth.cs
index 4d0e7ea..10256d2 100644
--- a/Assets/_Project/Scripts/Gameplay/EnemyHealth.cs
+++ b/Assets/_Project/Scripts/Gameplay/EnemyHealth.cs
@@ -126,6 +126,9 @@ namespace TD.Gameplay
///
public event System.Action OnDied;
+ /// Fired on ALL peers the moment this enemy dies. Use for client-side visuals and audio.
+ public event System.Action OnDiedClient;
+
// ----- Server-only pre-spawn init -------------------------------------
///
@@ -240,6 +243,7 @@ namespace TD.Gameplay
if (deathAnimator != null)
deathAnimator.SetTrigger(DieHash);
+ DiedClientRpc();
StartCoroutine(DeathSequence());
}
@@ -263,6 +267,12 @@ namespace TD.Gameplay
// mesh sizes substantially, derive this from a collider bounds instead.
public float SelectionRadius => 0.4f;
+ [ClientRpc]
+ private void DiedClientRpc()
+ {
+ OnDiedClient?.Invoke();
+ }
+
private IEnumerator DeathSequence()
{
// Hold while the death animation plays.
diff --git a/Assets/_Project/Scripts/Gameplay/TowerInstance.cs b/Assets/_Project/Scripts/Gameplay/TowerInstance.cs
index 724776e..e459f01 100644
--- a/Assets/_Project/Scripts/Gameplay/TowerInstance.cs
+++ b/Assets/_Project/Scripts/Gameplay/TowerInstance.cs
@@ -166,6 +166,11 @@ namespace TD.Gameplay
}
}
+ // ----- Events ---------------------------------------------------------
+
+ /// Fired on ALL peers when this tower finishes construction and spawns.
+ public event System.Action OnBuiltClient;
+
// ----- Server-only initialization -------------------------------------
///
@@ -262,6 +267,8 @@ namespace TD.Gameplay
$"for {ownerSlot.Value} at anchor {anchorTile.Value}. " +
$"IsServer={IsServer}");
}
+
+ OnBuiltClient?.Invoke();
}
public override void OnNetworkDespawn()
diff --git a/ProjectSettings/Packages/com.unity.probuilder/Settings.json b/ProjectSettings/Packages/com.unity.probuilder/Settings.json
index f70e4ce..c46a6fa 100644
--- a/ProjectSettings/Packages/com.unity.probuilder/Settings.json
+++ b/ProjectSettings/Packages/com.unity.probuilder/Settings.json
@@ -155,6 +155,11 @@
"type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
"key": "editor.dragSelectRectMode",
"value": "{\"m_Value\":0}"
+ },
+ {
+ "type": "UnityEditor.ProBuilder.Actions.ExportAssetOptions, Unity.ProBuilder.Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+ "key": "export.assetOptions",
+ "value": "{\"m_Value\":{\"makePrefab\":false,\"replaceOriginal\":false}}"
}
]
}