more improvements on journey and sentinel
This commit is contained in:
parent
1926420695
commit
3eece75820
@ -78,6 +78,7 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JourneyManager
|
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JourneyManager
|
||||||
subscriptionId: 5df34d67e6e44f3999042072ea652750
|
subscriptionId: 5df34d67e6e44f3999042072ea652750
|
||||||
curtainType: {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
|
curtainType: {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
|
||||||
|
actionBeltManager: {fileID: 11400000, guid: 24d31645b4d544dd69b6ada8858ba50e, type: 2}
|
||||||
journeyService: {fileID: 11400000, guid: 53f1211059b4847a49bde1be4b8d166c, type: 2}
|
journeyService: {fileID: 11400000, guid: 53f1211059b4847a49bde1be4b8d166c, type: 2}
|
||||||
backStageService: {fileID: 11400000, guid: c58e40006278948db8d8b1f3477f83ea, type: 2}
|
backStageService: {fileID: 11400000, guid: c58e40006278948db8d8b1f3477f83ea, type: 2}
|
||||||
isRunningTest: 0
|
isRunningTest: 0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -69,7 +69,7 @@ namespace Intrepid.Core.Entities
|
|||||||
return !ShouldBeTriggered(entities, physicsTags);
|
return !ShouldBeTriggered(entities, physicsTags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void DeployEntity(Vector3 position);
|
public abstract void DeployEntity(Vector3 position, Vector2 direction);
|
||||||
public abstract void RetreatEntity();
|
public abstract void RetreatEntity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,15 +65,18 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
|
|||||||
if (CurrentState == SentinelStateType.Fall) return;
|
if (CurrentState == SentinelStateType.Fall) return;
|
||||||
StateMachine.ChangeState(SentinelStateType.Fall);
|
StateMachine.ChangeState(SentinelStateType.Fall);
|
||||||
});
|
});
|
||||||
Subscribe<ChangeStageStartEvent>(e =>
|
Subscribe<ChangeStageStartEvent>(_ =>
|
||||||
{
|
{
|
||||||
Entity.RetreatEntity();
|
Entity.RetreatEntity();
|
||||||
IsEnabled = false;
|
IsEnabled = false;
|
||||||
|
});
|
||||||
|
Subscribe<ChangeStageTouchedEvent>(_ =>
|
||||||
|
{
|
||||||
ChangeState(SentinelStateType.Nop);
|
ChangeState(SentinelStateType.Nop);
|
||||||
});
|
});
|
||||||
Subscribe<StageDispatchDeploymentPointEvent>(e =>
|
Subscribe<StageDispatchDeploymentPointEvent>(e =>
|
||||||
{
|
{
|
||||||
Entity.DeployEntity(e.DeploymentPoint);
|
Entity.DeployEntity(e.DeploymentPoint, e.DeploymentDirection);
|
||||||
CameraSystem.Instance.ForceFocusOn(e.DeploymentPoint);
|
CameraSystem.Instance.ForceFocusOn(e.DeploymentPoint);
|
||||||
IsEnabled = true;
|
IsEnabled = true;
|
||||||
Proxy.Instance.EventBus.Raise(new EmitFloorDetectionEvent
|
Proxy.Instance.EventBus.Raise(new EmitFloorDetectionEvent
|
||||||
|
|||||||
@ -38,9 +38,10 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
|
|||||||
public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles;
|
public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles;
|
||||||
public FloorDetection FloorDetection => floorDetection;
|
public FloorDetection FloorDetection => floorDetection;
|
||||||
|
|
||||||
public override void DeployEntity(Vector3 position)
|
public override void DeployEntity(Vector3 position, Vector2 direction)
|
||||||
{
|
{
|
||||||
UnityRigidbody.position = position;
|
UnityRigidbody.position = position;
|
||||||
|
ChangeOrientation(direction);
|
||||||
|
|
||||||
UnityRigidbody.isKinematic = false;
|
UnityRigidbody.isKinematic = false;
|
||||||
CapsuleCollider.enabled = true;
|
CapsuleCollider.enabled = true;
|
||||||
|
|||||||
@ -16,12 +16,16 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
|||||||
|
|
||||||
protected override void RunOnEnter(ParameterStore ps)
|
protected override void RunOnEnter(ParameterStore ps)
|
||||||
{
|
{
|
||||||
|
EndCadence();
|
||||||
|
Brain.Controls.ResetDash();
|
||||||
|
Brain.InputResolver.Sentinel.Clear();
|
||||||
Brain.Entity.ModelAnimation.Pause();
|
Brain.Entity.ModelAnimation.Pause();
|
||||||
Brain.Entity.DesiredVelocity = Vector2.zero;
|
Brain.Entity.DesiredVelocity = Vector2.zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void RunOnExit()
|
protected override void RunOnExit()
|
||||||
{
|
{
|
||||||
|
Brain.Entity.ModelAnimation.Unpause();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RunOnUpdate()
|
public override void RunOnUpdate()
|
||||||
|
|||||||
@ -3,6 +3,8 @@ using System.Collections;
|
|||||||
using Intrepid.Core.Camera;
|
using Intrepid.Core.Camera;
|
||||||
using Intrepid.Diagnostics;
|
using Intrepid.Diagnostics;
|
||||||
using Intrepid.GameManagers;
|
using Intrepid.GameManagers;
|
||||||
|
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
|
||||||
|
using Intrepid.Gameplay.Entities.Player.Tags;
|
||||||
using Intrepid.Gameplay.Journey.Messages;
|
using Intrepid.Gameplay.Journey.Messages;
|
||||||
using Intrepid.Gameplay.Journey.Messages.Events;
|
using Intrepid.Gameplay.Journey.Messages.Events;
|
||||||
using Intrepid.Integration.Input;
|
using Intrepid.Integration.Input;
|
||||||
@ -20,6 +22,7 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
private const string Id = "JourneyManager";
|
private const string Id = "JourneyManager";
|
||||||
|
|
||||||
[GroupConfigurations, SerializeField] private CurtainTypeTag curtainType;
|
[GroupConfigurations, SerializeField] private CurtainTypeTag curtainType;
|
||||||
|
[GroupInjections, SerializeField] private ActionBeltManagerTag actionBeltManager;
|
||||||
[GroupInjections, SerializeField] private JourneyService journeyService;
|
[GroupInjections, SerializeField] private JourneyService journeyService;
|
||||||
[GroupInjections, SerializeField] private BackStageService backStageService;
|
[GroupInjections, SerializeField] private BackStageService backStageService;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
@ -39,6 +42,7 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
private IBackStageWindowExecution CallbackProcessors { get; set; }
|
private IBackStageWindowExecution CallbackProcessors { get; set; }
|
||||||
private string DestinyEndpoint { get; set; }
|
private string DestinyEndpoint { get; set; }
|
||||||
private InputSchema LastInputSchema { get; set; } = InputSchema.None;
|
private InputSchema LastInputSchema { get; set; } = InputSchema.None;
|
||||||
|
public ICurtainProgress OpenCurtainProgress { get; set; }
|
||||||
|
|
||||||
public bool IsProcessFinished => StageStateMachine.IsLoadingFinished && !CameraSystem.Instance.IsCameraBlending;
|
public bool IsProcessFinished => StageStateMachine.IsLoadingFinished && !CameraSystem.Instance.IsCameraBlending;
|
||||||
|
|
||||||
@ -68,6 +72,11 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
BackStageService.UpdateCurtains();
|
BackStageService.UpdateCurtains();
|
||||||
|
if (OpenCurtainProgress?.IsFinished() ?? false)
|
||||||
|
{
|
||||||
|
OpenCurtainProgress = null;
|
||||||
|
AfterOpened();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnTearDown()
|
protected override void OnTearDown()
|
||||||
@ -108,8 +117,7 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
{
|
{
|
||||||
DeploymentPoint = landing.position,
|
DeploymentPoint = landing.position,
|
||||||
});
|
});
|
||||||
Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
|
OpenCurtainProgress = Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
|
||||||
InputService.Instance.ChangeInputSchema(InputSchema.Sentinel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
|
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
|
||||||
@ -148,7 +156,14 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
DestinyEndpoint = null;
|
DestinyEndpoint = null;
|
||||||
CallbackProcessors?.AfterOpened();
|
CallbackProcessors?.AfterOpened();
|
||||||
Proxy.Instance.EventBus.Raise(new ChangeStageEndEvent());
|
Proxy.Instance.EventBus.Raise(new ChangeStageEndEvent());
|
||||||
InputService.Instance.ChangeInputSchema(LastInputSchema);
|
var lastInputSchema = LastInputSchema == InputSchema.None
|
||||||
|
? InputSchema.Sentinel
|
||||||
|
: LastInputSchema;
|
||||||
|
InputService.Instance.ChangeInputSchema(lastInputSchema);
|
||||||
|
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent
|
||||||
|
{
|
||||||
|
ActionBeltManger = actionBeltManager,
|
||||||
|
});
|
||||||
LastInputSchema = InputSchema.None;
|
LastInputSchema = InputSchema.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +188,11 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
LastInputSchema = InputService.Instance.CurrentInputSchema;
|
LastInputSchema = InputService.Instance.CurrentInputSchema;
|
||||||
InputService.Instance.ChangeInputSchema(InputSchema.None);
|
InputService.Instance.ChangeInputSchema(InputSchema.None);
|
||||||
CallbackProcessors?.BeforeClosing();
|
CallbackProcessors?.BeforeClosing();
|
||||||
|
Proxy.Instance.EventBus.Raise(new ChangeStageTouchedEvent());
|
||||||
|
Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent
|
||||||
|
{
|
||||||
|
ActionBeltManger = actionBeltManager,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Intrepid.Gameplay.Journey
|
namespace Intrepid.Gameplay.Journey
|
||||||
{
|
{
|
||||||
@ -17,6 +18,25 @@ namespace Intrepid.Gameplay.Journey
|
|||||||
West = 3
|
West = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class JSocketFaceUtils
|
||||||
|
{
|
||||||
|
private static readonly Vector2 North = new(0, -1);
|
||||||
|
private static readonly Vector2 South = new(0, 1);
|
||||||
|
private static readonly Vector2 East = new(-1, 0);
|
||||||
|
private static readonly Vector2 West = new(1, 0);
|
||||||
|
|
||||||
|
public static Vector2 DeploymentDirection(JSocketFace socketFace) => socketFace switch
|
||||||
|
{
|
||||||
|
JSocketFace.North => North,
|
||||||
|
JSocketFace.South => South,
|
||||||
|
JSocketFace.East => East,
|
||||||
|
JSocketFace.West => West,
|
||||||
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public enum JConnectionDirectionality
|
public enum JConnectionDirectionality
|
||||||
{
|
{
|
||||||
Bidirectional = 0,
|
Bidirectional = 0,
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
using Intrepid.SimpleEvents;
|
||||||
|
|
||||||
|
namespace Intrepid.Gameplay.Journey.Messages.Events
|
||||||
|
{
|
||||||
|
public class ChangeStageTouchedEvent : IEventBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d2914d429ed54d52bb3cfcf0e7d9b847
|
||||||
|
timeCreated: 1782204481
|
||||||
@ -6,5 +6,6 @@ namespace Intrepid.Gameplay.Journey.Messages.Events
|
|||||||
public class StageDispatchDeploymentPointEvent : IEventBase
|
public class StageDispatchDeploymentPointEvent : IEventBase
|
||||||
{
|
{
|
||||||
public Vector3 DeploymentPoint { get; set; }
|
public Vector3 DeploymentPoint { get; set; }
|
||||||
|
public Vector2 DeploymentDirection { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,6 +9,7 @@ namespace Intrepid.Gameplay.Journey.Stages.Sockets
|
|||||||
[GroupInjections, SerializeField] private Transform deploymentPoint;
|
[GroupInjections, SerializeField] private Transform deploymentPoint;
|
||||||
[GroupInjections, SerializeField] private StageSocketChangeTrigger changeTrigger;
|
[GroupInjections, SerializeField] private StageSocketChangeTrigger changeTrigger;
|
||||||
[GroupConfigurations, SerializeField] private string endpointId;
|
[GroupConfigurations, SerializeField] private string endpointId;
|
||||||
|
[GroupConfigurations, SerializeField] private JSocketFace socketFace;
|
||||||
|
|
||||||
public string StageId
|
public string StageId
|
||||||
{
|
{
|
||||||
@ -21,6 +22,7 @@ namespace Intrepid.Gameplay.Journey.Stages.Sockets
|
|||||||
set => endpointId = value;
|
set => endpointId = value;
|
||||||
}
|
}
|
||||||
public Vector3 DeploymentPoint => deploymentPoint.position;
|
public Vector3 DeploymentPoint => deploymentPoint.position;
|
||||||
|
public Vector2 DeploymentDirection => JSocketFaceUtils.DeploymentDirection(socketFace);
|
||||||
|
|
||||||
private void OnValidate()
|
private void OnValidate()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,6 +35,7 @@ namespace Intrepid.Gameplay.Journey.Stages
|
|||||||
Proxy.Instance.EventBus.Raise(new StageDispatchDeploymentPointEvent
|
Proxy.Instance.EventBus.Raise(new StageDispatchDeploymentPointEvent
|
||||||
{
|
{
|
||||||
DeploymentPoint = stageSocket.DeploymentPoint,
|
DeploymentPoint = stageSocket.DeploymentPoint,
|
||||||
|
DeploymentDirection = stageSocket.DeploymentDirection,
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
using Intrepid.Core.Camera.Events;
|
using Intrepid.Core.Camera.Events;
|
||||||
using Intrepid.GameManagers;
|
using Intrepid.GameManagers;
|
||||||
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
|
|
||||||
using Intrepid.Gameplay.Entities.Player.Sentinel;
|
using Intrepid.Gameplay.Entities.Player.Sentinel;
|
||||||
using Intrepid.Gameplay.Entities.Player.Tags;
|
|
||||||
using Intrepid.Utilities;
|
using Intrepid.Utilities;
|
||||||
using Sirenix.OdinInspector;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Temporary
|
namespace Temporary
|
||||||
@ -12,33 +9,13 @@ namespace Temporary
|
|||||||
public class TempBoot : MonoBehaviour
|
public class TempBoot : MonoBehaviour
|
||||||
{
|
{
|
||||||
[GroupInjections, SerializeField] private SentinelCameraManager sentinelCameraManager;
|
[GroupInjections, SerializeField] private SentinelCameraManager sentinelCameraManager;
|
||||||
[GroupConfigurations, SerializeField] private ActionBeltManagerTag _amTag;
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
EnableActionManager(_amTag);
|
|
||||||
Proxy.Instance.EventBus.Raise(new CameraStreamChangeEvent
|
Proxy.Instance.EventBus.Raise(new CameraStreamChangeEvent
|
||||||
{
|
{
|
||||||
CameraStreamStack = sentinelCameraManager.CameraStreamStack,
|
CameraStreamStack = sentinelCameraManager.CameraStreamStack,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
|
|
||||||
private void EnableActionManager(ActionBeltManagerTag amTag)
|
|
||||||
{
|
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent
|
|
||||||
{
|
|
||||||
ActionBeltManger = amTag ?? _amTag,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
|
|
||||||
private void DisableActionManager(ActionBeltManagerTag amTag)
|
|
||||||
{
|
|
||||||
Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent
|
|
||||||
{
|
|
||||||
ActionBeltManger = amTag ?? _amTag,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user