Озвучка при уроне, новая музыка

This commit is contained in:
ThomasCharester committed 2025-11-23 01:17:45 +03:00
1 parent e5f4f292c2
commit 35f703a8d2
21 files changed
+546 -271

No files matched your search

@@ -47,15 +47,15 @@ namespace Code.App.AppStates
.RegisterLoading(LoadingWork.WaitForSceneInstaller)
.RegisterLoading(LoadingWork.LoadUI)
.RegisterLoading(LoadingWork.LoadModelResource)
.RegisterLoading(LoadingWork.LoadAudio);
// Context.UIService.LoadingScreen.Show();
.RegisterLoading(LoadingWork.LoadAudio);
_playerMoney = Context.PlayerFactory.CreatePlayerMoney();
_playerHealth = Context.PlayerFactory.CreatePlayerHealth();
_playerHealth.OnDamage += PlayerDamageTaken;
_playerHealth.OnDeath += EndGame;
Context.AudioService.TransitToSnapshot(AudioSnapshotState.Peaceful);
Context.AudioService.TransitToSnapshot(AudioSnapshotState.None);
Context.InputService.EnableMap(ActionMappings.Gameplay);
@@ -64,7 +64,7 @@ namespace Code.App.AppStates
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug3, DeliverOrderDEBUG);
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, RoomPassedDEBUG);
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug5, Tube);
// Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug6, PlayDebugDispatcher);
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.Debug6, TakeDamageDEBUG);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
WaitForSceneToLoad();
@@ -118,6 +118,7 @@ namespace Code.App.AppStates
private void OrderGiven(float time)
{
_gameplayPanel.ShowTimer();
Context.AudioService.TransitToSnapshot(AudioSnapshotState.Action);
}
private void OrderFailure()
{
@@ -133,13 +134,23 @@ namespace Code.App.AppStates
if(time < 0f) Context.AudioService.PlayDispatcher((DispatcherSounds)Random.Range((int)DispatcherSounds.Late1,(int)DispatcherSounds.Late2));
_playerMoney.GiveMoney(score);
Context.AudioService.TransitToSnapshot(AudioSnapshotState.Peaceful);
}
private void PlayerDamageTaken(int damage, PlayerHealth health)
{
Context.AudioService.PlayDispatcher((DispatcherSounds)Random.Range((int)DispatcherSounds.TakeDamage1,(int)DispatcherSounds.TakeDamage4));
}
// DEBUG
private void GiveOrderDEBUG(InputAction.CallbackContext context)
{
_orderService.OrderGive();
}
private void TakeDamageDEBUG(InputAction.CallbackContext context)
{
_playerHealth.GetDamage(1);
}
private void RecieveOrderDEBUG(InputAction.CallbackContext context)
{
_orderService.OrderRecieved();
@@ -186,6 +197,9 @@ namespace Code.App.AppStates
_armsMesh = null;
_orderService = null;
Context.AudioService.OnDispatcherStarted -= _gameplayPanel.SummonDispatcher;
Context.AudioService.OnDispatcherEnded -= _gameplayPanel.CloseDispatcher;
Context.InputService.DisableMap(ActionMappings.Gameplay);
Context.AudioService.GladlyAskToStopMusic(MusicType.Action, callback: Context.AudioFactory.ReleaseActionMusic);
Context.AudioService.GladlyAskToStopMusic(MusicType.Peaceful, callback: Context.AudioFactory.ReleasePeacefulMusic);
@@ -196,7 +210,7 @@ namespace Code.App.AppStates
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug3, DeliverOrderDEBUG);
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug4, RoomPassedDEBUG);
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug5, Tube);
// Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug6, PlayDebugDispatcher);
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug6, TakeDamageDEBUG);
base.ExitState();
}
@@ -225,6 +239,7 @@ namespace Code.App.AppStates
{
Context.AudioService.PlayRandomMusicUntilHumanityWillBeDestroyedForTheySins(MusicType.Peaceful);
Context.AudioService.PlayRandomMusicUntilHumanityWillBeDestroyedForTheySins(MusicType.Action);
Context.AudioService.TransitToSnapshot(AudioSnapshotState.Peaceful);
}
private void PlayerInitialize(GameplaySceneEnvironment sceneEnvironment)
{