This commit is contained in:
CortexCore
2023-10-24 23:37:59 +08:00
parent 325f63d6bc
commit 3e39e627bc
388 changed files with 29043 additions and 889 deletions

View File

@@ -35,6 +35,19 @@ namespace BITFALL.Entities.Player.Movement
[SerializeField] private Transform fpvPoint;
public Vector3 Position
{
get => actor.Position;
set=>actor.Position = value;
}
public Quaternion Rotation
{
get => actor.Rotation;
set => actor.Rotation = value;
}
public Vector3 Forward => actor.Forward;
public Vector3 ViewCenter { get; set; }
public Quaternion ViewRotation { get; set; }
public Vector3 LocomotionBasedVelocity { get;private set; }
@@ -230,6 +243,11 @@ namespace BITFALL.Entities.Player.Movement
return;
}
if (MovementInput.x is not 0 && MovementInput.z is 0)
{
TransitionState<Dodge>();
return;
}
if (climbClosePoint.TryGetClosePoint(out var closePoint))
{
ExpectClimb.shouldBe = closePoint;
@@ -345,15 +363,15 @@ namespace BITFALL.Entities.Player.Movement
case < -16:
entity.Invoke<DamageMessage>(new DamageMessage()
{
damage = value < -30 ? int.MaxValue : (int)math.abs(value) * 2 ,
damageType = new GravityDamage(),
location = new Location()
Damage = value < -30 ? int.MaxValue : (int)math.abs(value) * 2 ,
DamageType = new GravityDamage(),
Location = new Location()
{
position = actor.Position,
rotation = actor.Rotation
},
initiator = entity,
target = entity,
Initiator = entity,
Target = entity,
});
break;
}
@@ -393,7 +411,8 @@ namespace BITFALL.Entities.Player.Movement
ViewRotation = rotation;
ViewCenter = additiveTransform.position + additiveTransform.forward;
//ViewCenter = additiveTransform.position + additiveTransform.forward;
ViewCenter = additiveTransform.position + Quaternion.Euler(LookInput) * Vector3.forward;
}
private float _stamina = 100;
public float Stamina