Essentials + extra crap
Loadings Startups Movement Camera
This commit is contained in:
1 parent
662f4a1d05
commit
5f5ace1b52
734 files changed
+107323
-1713
No files matched your search
+44
@@ -0,0 +1,44 @@
|
||||
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Infrastructure.Camera
|
||||
{
|
||||
|
||||
public partial class CameraStateMachine : AbstractStateMachine<Code.Infrastructure.Camera.CameraMode,Code.Infrastructure.Camera.CameraStateMachineContext>
|
||||
{
|
||||
|
||||
public CameraStateMachine(Code.Infrastructure.Camera.CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context)
|
||||
{
|
||||
|
||||
var stateNoneCameraState = new NoneCameraState(StateMachineContext,eventBus);
|
||||
States.Add(stateNoneCameraState.myState, stateNoneCameraState);
|
||||
|
||||
var stateFirstPersonCameraState = new FirstPersonCameraState(StateMachineContext,eventBus);
|
||||
States.Add(stateFirstPersonCameraState.myState, stateFirstPersonCameraState);
|
||||
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Infrastructure.Camera.CameraMode nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class CameraStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> stateMachine, Code.Infrastructure.Camera.CameraMode state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user