Merge branch 'Dev' into Levels2

This commit is contained in:
ThomasCharester committed 2025-12-05 09:14:10 +03:00
commit db6eb219c8
114 files changed
+619 -374562

No files matched your search

@@ -65,7 +65,7 @@ namespace Code.App.AppStates
Context.UIService.AsyncSwitchPanelTo(UIPanel.Gameplay),
Context.AudioFactory.WarmGameplayMusic(),
Context.AudioFactory.WarmDeathMusic(),
Context.AudioFactory.WarmSFX(),
// Context.AudioFactory.WarmSFX(),
Context.AudioFactory.WarmDispatcher(),
Context.AudioFactory.WarmEnemies(),
Context.AudioFactory.WarmCourier()
@@ -217,7 +217,7 @@ namespace Code.App.AppStates
Context.AudioFactory.ReleaseCourier();
Context.AudioFactory.ReleaseDispatcher();
Context.AudioFactory.ReleaseEnemies();
Context.AudioFactory.ReleaseSFX();
// Context.AudioFactory.ReleaseSFX();
Context.InputService.DebugUnbindAction((int)ActionMappings.Debug, (int)DebugActions.Debug1, InstaKillDEBUG);
@@ -1,13 +1,10 @@
namespace Code.Audio
{
public enum SFXSounds
{
Crowbar,
Shot357
{
}
public enum UISounds
{
Crowbar
{
}
public enum EnemiesSounds
{
@@ -132,7 +132,7 @@ namespace Code.Audio
_musicAudioSources[musicType].spatialBlend = _settings[AudioSourceType.NoBlend].spatialBlend;
_musicAudioSources[musicType].outputAudioMixerGroup = _musicAudioGroups[musicType];
}
_musicAudioSources[musicType].resource =
_audioFactory.MusicDictionary[musicType][
Random.Range(0, _audioFactory.MusicDictionary[musicType].Count)];
@@ -88,12 +88,25 @@ namespace Code.Gameplay.Character.Controller.Abilities
var forwardInWallPlane = Vector3.ProjectOnPlane(_motor.CharacterForward, _wallNormal).normalized;
if (forwardInWallPlane.sqrMagnitude < 0.01f)
{
var fallbackRight = Vector3.Cross(_wallNormal, _wallTangentUp).normalized;
var candidateRight = Vector3.Cross(_wallNormal, _motor.CharacterUp);
candidateRight = Vector3.ProjectOnPlane(candidateRight, _wallNormal).normalized;
if (candidateRight.sqrMagnitude < 0.01f)
{
candidateRight = Vector3.Cross(_wallNormal, Vector3.up);
candidateRight = Vector3.ProjectOnPlane(candidateRight, _wallNormal).normalized;
}
if (candidateRight.sqrMagnitude < 0.01f)
{
candidateRight = Vector3.Cross(_wallNormal, Vector3.right).normalized;
}
var dotWithRight = Vector3.Dot(_motor.CharacterRight, _wallNormal);
forwardInWallPlane = dotWithRight < 0 ? fallbackRight : -fallbackRight;
forwardInWallPlane = dotWithRight < 0 ? candidateRight : -candidateRight;
}
_wallTangentRight = forwardInWallPlane;
_wallTangentRight = forwardInWallPlane.normalized;
_wallTangentUp = Vector3.Cross(_wallTangentRight, -_wallNormal).normalized;
_motor.ForceUnground();
@@ -189,13 +202,13 @@ namespace Code.Gameplay.Character.Controller.Abilities
{
if (!IsWallRunning || !_motor) return;
if (_motor.CharacterController is not CustomCharacterController controller || !controller.CanJump)
if (_motor.CharacterController is not CustomCharacterController { CanJump: true } controller)
return;
IsWallRunning = false;
var wallAway = _wallNormal;
var wallUp = _wallTangentUp;
var wallUp = Vector3.ProjectOnPlane(_motor.CharacterUp, _wallNormal).normalized;
var playerForward = cameraRotation * Vector3.forward;
@@ -204,8 +217,8 @@ namespace Code.Gameplay.Character.Controller.Abilities
var jumpDirection =
forwardInWallPlane * 0.2f +
wallAway * 0.4f +
wallUp * 0.4f;
wallAway * 0.6f +
wallUp * 0.2f;
jumpDirection = jumpDirection.normalized;
@@ -17,7 +17,7 @@ namespace Code.Gameplay.Enemies
_audioService = audioService;
_audioSource = audioService.GetSourceOfGroup(Audio.AudioType.Enemies);
_audioSource.transform.position = transform.position;
_audioSource.spatialBlend = 0;
_audioSource.spatialBlend = 1f;
_audioFactory = audioFactory;
}