Звуки шагов в моей голове
This commit is contained in:
1 parent
1e31e1e8b1
commit
36e6bc3bc2
24 files changed
+227272
-29
No files matched your search
@@ -13,6 +13,7 @@ namespace Code.Audio
|
||||
{
|
||||
Bastard,
|
||||
Bravo,
|
||||
RoachStep,
|
||||
GrandpaStep
|
||||
}
|
||||
public enum DispatcherSounds
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Code.Gameplay.Enemies
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
if (agent == null) return;
|
||||
if (!agent) return;
|
||||
|
||||
var walkableArea = NavMesh.GetAreaFromName("Cockroach");
|
||||
agent.areaMask = 1 << walkableArea;
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using Code.Audio;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Gameplay.Enemies
|
||||
{
|
||||
public class EnemyAudio : MonoBehaviour
|
||||
{
|
||||
private IAudioService _audioService;
|
||||
private IAudioFactory _audioFactory;
|
||||
private AudioSource _audioSource;
|
||||
[SerializeField] private EnemiesSounds stepId;
|
||||
|
||||
[Inject]
|
||||
private void Construct(IAudioService audioService, IAudioFactory audioFactory)
|
||||
{
|
||||
_audioService = audioService;
|
||||
_audioSource = audioService.GetSourceOfGroup(Audio.AudioType.Enemies);
|
||||
_audioSource.transform.position = transform.position;
|
||||
|
||||
_audioFactory = audioFactory;
|
||||
}
|
||||
|
||||
public void PlayStep()
|
||||
{
|
||||
Debug.Log("Play Step");
|
||||
_audioSource.transform.position = transform.position;
|
||||
_audioSource.PlayOneShot(_audioFactory.EnemiesAudios[(int)stepId]);
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
_audioService.ReleaseSourceOfGroup(_audioSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 91cb250df1b24fc4825ee791a12dda11
|
||||
timeCreated: 1764695102
|
||||
Reference in new issue
Block a user