28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using Code.Configs;
|
|
using Code.Gameplay.Camera.CameraStates;
|
|
using Code.StateMachine;
|
|
|
|
namespace Code.Gameplay.Camera
|
|
{
|
|
public class CameraStateMachine : AbstractStateMachine<CameraMode, CameraStateMachineContext>
|
|
{
|
|
// Текущий режим работы камеры
|
|
public override void Initialize()
|
|
{
|
|
States.Add(CameraMode.None, new NoneState(StateMachineContext));
|
|
States.Add(CameraMode.Static, new StaticState(StateMachineContext));
|
|
States.Add(CameraMode.MainMenu, new MainMenuState(StateMachineContext));
|
|
States.Add(CameraMode.FirstPerson, new FirstPersonState(StateMachineContext));
|
|
States.Add(CameraMode.ThirdPerson, new ThirdPersonState(StateMachineContext));
|
|
|
|
CurrentBaseState = States[CameraMode.None];
|
|
}
|
|
|
|
public UnityEngine.Camera Camera => StateMachineContext.Camera;
|
|
|
|
protected override bool CheckTransitionAllowed(CameraMode nextState) => true;
|
|
|
|
protected override void ResetAllowedTransitions()
|
|
{ }
|
|
}
|
|
} |