Skip to content

Commit

Permalink
fix hero
Browse files Browse the repository at this point in the history
  • Loading branch information
brizzinck committed Oct 29, 2023
1 parent 794c5f9 commit d725fcc
Show file tree
Hide file tree
Showing 6 changed files with 504 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Assets/CodeBase/Infrastructure/States/GameStateMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public GameStateMachine(SceneLoader sceneLoader, LoadingCurtain loadingCurtain,
services.Single<ISaveLoadService>()),

[typeof(LoadEndMenuState)] =
new LoadEndMenuState(this, endGameCurtain, sceneLoader, services.Single<IUIFactory>()),
new LoadEndMenuState(this, endGameCurtain, sceneLoader, services.Single<IUIFactory>(),
services.Single<IAudioPlayer>()),

[typeof(GameLoopState)] = new GameLoopState(this),

Expand Down
7 changes: 6 additions & 1 deletion Assets/CodeBase/Infrastructure/States/LoadEndMenuState.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CodeBase.Infrastructure.Scene;
using CodeBase.Logic.Scene;
using CodeBase.Services.Audio;
using CodeBase.UI.Services.Factory;

namespace CodeBase.Infrastructure.States
Expand All @@ -10,14 +11,16 @@ public class LoadEndMenuState : IPayloadedState<string>
private readonly LoadingCurtain _endGameCurtain;
private readonly SceneLoader _sceneLoader;
private readonly IUIFactory _uiFactory;
private readonly IAudioPlayer _audioPlayer;

public LoadEndMenuState(IGameStateMachine stateMachine, LoadingCurtain endGameCurtain, SceneLoader sceneLoader,
IUIFactory uiFactory)
IUIFactory uiFactory, IAudioPlayer audioPlayer)
{
_stateMachine = stateMachine;
_endGameCurtain = endGameCurtain;
_sceneLoader = sceneLoader;
_uiFactory = uiFactory;
_audioPlayer = audioPlayer;
}

public void Enter(string payload = "Menu")
Expand All @@ -30,6 +33,8 @@ private async void OnLoaded()
{
_stateMachine.Enter<MenuStayLevelState>();
await _uiFactory.CreateEndUI();
await _audioPlayer.CreateAudio();
_audioPlayer.PlayCurrentScene();
}

public void Exit() =>
Expand Down
16 changes: 16 additions & 0 deletions Assets/Resources/StaticData/Levels/EndMenu.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1212adfac194d8195dbcd863904d9c5, type: 3}
m_Name: EndMenu
m_EditorClassIdentifier:
LevelKey: Menu
SceneClip: {fileID: 8300000, guid: aa75e76510aba1c4c86c28c2540ca5a6, type: 3}
8 changes: 8 additions & 0 deletions Assets/Resources/StaticData/Levels/EndMenu.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions Assets/Resources/StaticData/Levels/Main.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,31 @@ MonoBehaviour:
SceneClip: {fileID: 8300000, guid: aa75e76510aba1c4c86c28c2540ca5a6, type: 3}
HeroSpawnPoint: {x: 2.4, y: -10.2, z: 0}
InteractiveSpawnMarker:
- Id: Main_b7bce769-afce-4365-9e91-2c73d281ff7b
InteractiveID: 5
Position: {x: -6.91, y: 8.25, z: -0.021649772}
- Id: InteractiveSpawnerPoint_b97a3fdc-5097-41a7-a11d-0fafa2d428da
InteractiveID: 2
Position: {x: -4.97, y: 4.07, z: -0.021649772}
- Id: Main_b7bce769-afce-4365-9e91-2c73d281ff7b
InteractiveID: 2
Position: {x: -6.91, y: 8.25, z: -0.021649772}
NPCSpawnMarker:
- NpcId: 0
Id: Main_c23c370a-c253-49d7-8205-b8617ca3cbe6
Position: {x: 13.723338, y: -15.294007, z: 0}
- NpcId: 0
Id: Main_720a416e-7e4a-4a32-9aa4-9d527e5f4f16
Position: {x: 7.8633375, y: -15.454007, z: 0}
- NpcId: 0
Id: Main_75925684-2df8-4789-bc2e-6f8db957f7ec
Position: {x: 2.5233383, y: -16.174007, z: 0}
- NpcId: 0
Id: Main_de39e87d-4d16-4d26-9d53-6034f7fb15d8
Position: {x: -4.1366615, y: -16.134008, z: 0}
- NpcId: 0
Id: Main_1e7b6bf1-c5c9-435f-bf21-3ea0dcb43bc8
Position: {x: 0.07333851, y: -15.974008, z: 0}
- NpcId: 0
Id: Main_d4233b60-8229-4448-b3b4-35d1cc0595f7
Position: {x: 10.663339, y: -15.454007, z: 0}
- NpcId: 0
Id: Main_b8f1c297-9efe-4ae8-8213-9515bd728a32
Position: {x: 4.883338, y: -14.894008, z: 0}
Loading

0 comments on commit d725fcc

Please sign in to comment.