Теперь Addressables и UniTask в InstantiateAsync и прочих процессах
This commit is contained in:
1 parent
6b1f24b72e
commit
f940cbffe0
45 files changed
+811
-189
No files matched your search
@@ -0,0 +1,12 @@
|
||||
using Code.App.StateMachine;
|
||||
using Code.StateMachine;
|
||||
|
||||
namespace Code.App.AppStates
|
||||
{
|
||||
public class BootstrapState : BaseState<AppStateMachineContext>
|
||||
{
|
||||
public BootstrapState(AppStateMachineContext context) : base(context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0183e73a08c64332babded3df3d06b95
|
||||
timeCreated: 1762122962
|
||||
@@ -22,17 +22,19 @@ namespace Code.App.AppStates
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
_uiLoaded = _sceneLoaded = false;
|
||||
|
||||
Context.UIService.LoadingScreen.Show();
|
||||
|
||||
Context.SceneLoaderService.LoadSceneAsync((int)SceneIds.MovementDev, callBack: OnSceneLoaded); // TODO Фабрика говна Nada
|
||||
_playerMoney = Context.PlayerFactory.CreatePlayerMoney();
|
||||
_playerHealth = Context.PlayerFactory.CreatePlayerHealth();
|
||||
|
||||
_playerHealth.OnDeath += EndGame;
|
||||
|
||||
Context.SceneLoaderService.LoadSceneAsync((int)SceneIds.MovementDev, callBack: OnSceneLoaded); // TODO Фабрика игрока Nada
|
||||
|
||||
Context.UIService.SwitchPanelTo(UIPanel.Gameplay, callback: PostUILoaded);
|
||||
|
||||
_playerMoney = Context.PlayerFactory.CreatePlayerMoney();
|
||||
_playerHealth = Context.PlayerFactory.CreatePlayerHealth();
|
||||
|
||||
_playerHealth.OnDeath += EndGame;
|
||||
|
||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.GiveHealth, GiveHealth);
|
||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.GiveMoney, GiveMoney);
|
||||
Context.InputService.DebugBindAction((int)ActionMappings.Debug, (int)DebugActions.LooseHealth, LooseHealth);
|
||||
@@ -47,8 +49,7 @@ namespace Code.App.AppStates
|
||||
|
||||
private void PostUILoaded()
|
||||
{
|
||||
((GameplayPanel)(Context.UIService.CurrentPanel)).Initialize(_playerMoney, _playerHealth);
|
||||
Context.UIService.LoadingScreen.Hide();
|
||||
((GameplayPanel)Context.UIService.CurrentPanel).Initialize(_playerMoney, _playerHealth);
|
||||
_uiLoaded = true;
|
||||
CheckIfLoaded();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace Code.App.AppStates
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
_uiLoaded = false;
|
||||
_sceneLoaded = false;
|
||||
_uiLoaded = _sceneLoaded = false;
|
||||
|
||||
Context.UIService.LoadingScreen.Show();
|
||||
|
||||
|
||||
Reference in new issue
Block a user