Теперь камера - это стейт-машина
This commit is contained in:
1 parent
db541fed8a
commit
4549617275
31 files changed
+1145
-210
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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.Static, new StaticState(StateMachineContext));
|
||||
States.Add(CameraMode.FirstPerson, new FirstPersonState(StateMachineContext));
|
||||
States.Add(CameraMode.ThirdPerson, new ThirdPersonState(StateMachineContext));
|
||||
}
|
||||
|
||||
|
||||
protected override bool CheckTransitionAllowed(CameraMode nextState) => true;
|
||||
|
||||
protected override void ResetAllowedTransitions()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user