This commit is contained in:
CortexCore
2023-11-15 23:54:54 +08:00
parent ee3ecec6cb
commit 3c837a4a33
356 changed files with 73756 additions and 26493 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using BITFALL.Player.Equip;
using BITFALL.Player.Movement;
using BITKit;
using BITKit.Entities;
@@ -22,6 +23,8 @@ namespace BITFALL.Entities.Player.Movement.States
{
[SerializeField] protected float lerpDelta = 5;
private IntervalUpdate cancelInterval = new(0.16f);
public override void OnStateEntry(IState old)
{
base.OnStateEntry(old);
@@ -49,6 +52,8 @@ namespace BITFALL.Entities.Player.Movement.States
actor.ColliderComponent.enabled = true;
characterController.ExpectJump.Reset();
actor.ForceGrounded();
}
public override void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
@@ -69,6 +74,8 @@ namespace BITFALL.Entities.Player.Movement.States
private ISplineContainer _splineContainer;
private float progress;
private float increment;
[Inject] private IEquipService _equipService;
public override void OnStateEntry(IState old)
{
@@ -86,6 +93,8 @@ namespace BITFALL.Entities.Player.Movement.States
Init(characterController.OffMeshLink);
characterController.LimitViewAngle = 45;
_equipService.AllowEquip.AddDisableElements(this);
}
public override void OnStateExit(IState old, IState newState)
@@ -95,6 +104,8 @@ namespace BITFALL.Entities.Player.Movement.States
actor.ColliderComponent.enabled = true;
characterController.LimitViewAngle = 0;
_equipService.AllowEquip.RemoveDisableElements(this);
}
private void Init(OffMeshLink offMeshLink)
@@ -272,6 +283,8 @@ namespace BITFALL.Entities.Player.Movement.States
private IPlayerFixedPlace _fixedPlace;
[Inject] private ISelector _selector;
[Inject] private IEquipService _equipService;
public override void Initialize()
{
base.Initialize();
@@ -288,6 +301,8 @@ namespace BITFALL.Entities.Player.Movement.States
actor.alwaysNotGrounded = true;
characterController.ExpectCrouch.Reset();
characterController.LimitViewAngle = 100;
_equipService.AllowEquip.AddDisableElements(this);
}
public override void OnStateExit(IState old, IState newState)
@@ -299,6 +314,8 @@ namespace BITFALL.Entities.Player.Movement.States
actor.PhysicsComponent.enabled = true;
//actor.enabled = true;
characterController.LimitViewAngle = 0;
_equipService.AllowEquip.RemoveDisableElements(this);
}
public override void UpdateVelocity(ref Vector3 currentVelocity, float deltaTime)
{