UUUUUUUUUUUUUUUUH
This commit is contained in:
1 parent
e8393a28ad
commit
f0bb83c869
110 files changed
+55065
-21232
No files matched your search
@@ -1,5 +1,11 @@
|
||||
using Code.Infrastructure.App;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Code.Game.OfficeGame.GameStates
|
||||
{
|
||||
@@ -11,5 +17,39 @@ namespace Code.Game.OfficeGame.GameStates
|
||||
}
|
||||
|
||||
public override AppStates MyState => AppStates.BattleState;
|
||||
|
||||
public override async UniTask EnterState()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Confined;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
Context.InputService.EnableMap(ActionMappings.Debug);
|
||||
|
||||
Context.InputService.BindActionPerformed((int)ActionMappings.Debug, (int)DebugActions.ToggleBattleMode, ToggleBattleMode);
|
||||
#endif
|
||||
|
||||
Context.InputService.EnableMap(ActionMappings.BattleMode);
|
||||
|
||||
await Context.Camera.SwitchState(CameraMode.BattleMode);
|
||||
|
||||
var container = Context.SceneContainerManager.ScenesContainers[SceneId.Testing];
|
||||
|
||||
(Context.Camera.CurrentBaseState).EnterState();
|
||||
}
|
||||
|
||||
private void ToggleBattleMode(InputAction.CallbackContext obj)
|
||||
{
|
||||
Context.StateMachine.SwitchState(AppStates.Testing).Forget();
|
||||
}
|
||||
|
||||
public override async UniTask ExitState()
|
||||
{
|
||||
|
||||
#if UNITY_EDITOR
|
||||
Context.InputService.DisableMap(ActionMappings.Debug);
|
||||
Context.InputService.UnbindActionPerformed((int)ActionMappings.Debug, (int)DebugActions.ToggleBattleMode, ToggleBattleMode);
|
||||
#endif
|
||||
Context.InputService.DisableMap(ActionMappings.BattleMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user