1
This commit is contained in:
@@ -20,7 +20,7 @@ namespace BITFALL.Entities.Player.Movement
|
||||
{
|
||||
[CustomType(typeof(IEntityMovement))]
|
||||
[CustomType(typeof(IPlayerMovement))]
|
||||
public class PlayerCharacterController : StateBasedPlayerComponent<IEntityMovementState>,IEntityMovement,IPlayerMovement
|
||||
public class PlayerCharacterController : StateBasedPlayerBehavior<IEntityMovementState>,IEntityMovement,IPlayerMovement
|
||||
{
|
||||
[SerializeField] private CharacterActor actor;
|
||||
[SerializeField] private Vector3 initialCameraPosition = new(0,0.11f,0.27f);
|
||||
@@ -228,6 +228,7 @@ namespace BITFALL.Entities.Player.Movement
|
||||
{
|
||||
if (!x.TryGetComponent<OffMeshLink>(out var offMeshLink)) continue;
|
||||
var toTarget = x.transform.position - transform.position;
|
||||
|
||||
toTarget = Vector3.ProjectOnPlane(toTarget, Vector3.up);
|
||||
|
||||
// 获取正前方的向量
|
||||
@@ -361,7 +362,7 @@ namespace BITFALL.Entities.Player.Movement
|
||||
case > 0:
|
||||
break;
|
||||
case < -16:
|
||||
entity.Invoke<DamageMessage>(new DamageMessage()
|
||||
UnityEntity.Invoke<DamageMessage>(new DamageMessage()
|
||||
{
|
||||
Damage = value < -30 ? int.MaxValue : (int)math.abs(value) * 2 ,
|
||||
DamageType = new GravityDamage(),
|
||||
@@ -370,8 +371,8 @@ namespace BITFALL.Entities.Player.Movement
|
||||
position = actor.Position,
|
||||
rotation = actor.Rotation
|
||||
},
|
||||
Initiator = entity,
|
||||
Target = entity,
|
||||
Initiator = UnityEntity,
|
||||
Target = UnityEntity,
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ namespace BITFALL.Entities.Player.Movement.States
|
||||
public bool Enabled { get; set; }
|
||||
public virtual void Initialize()
|
||||
{
|
||||
characterController.entity.Inject(this);
|
||||
characterController.UnityEntity.Inject(this);
|
||||
}
|
||||
|
||||
public virtual void OnStateEntry(IState old)
|
||||
|
@@ -12,7 +12,7 @@ namespace BITFALL.Player.Animation
|
||||
{
|
||||
void OnMovementStateChanged(IEntityMovementState oldState, IEntityMovementState newState);
|
||||
}
|
||||
public class PlayerAnimationController : StateBasedComponent<IPlayerAnimationState>
|
||||
public class PlayerAnimationController : StateBasedBehavior<IPlayerAnimationState>
|
||||
{
|
||||
|
||||
[SerializeField] internal UnityAnimator animator;
|
||||
@@ -25,7 +25,7 @@ namespace BITFALL.Player.Animation
|
||||
public override void OnAwake()
|
||||
{
|
||||
base.OnAwake();
|
||||
_movement = entity.Get<IEntityMovement>();
|
||||
_movement = UnityEntity.Get<IEntityMovement>();
|
||||
_movement.OnStateChanged += OnMovementStateChanged;
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ using UnityEngine;
|
||||
|
||||
namespace BITFALL.Player.Survival
|
||||
{
|
||||
public class PlayerEatService : EntityComponent
|
||||
public class PlayerEatService : EntityBehavior
|
||||
{
|
||||
[Inject] private IPlayerSurvivalService _survival;
|
||||
[Inject] private IEntityInventory _inventory;
|
||||
|
@@ -15,7 +15,7 @@ namespace BITFALL.Player.Survival
|
||||
public string Message;
|
||||
}
|
||||
[CustomType(typeof(IPlayerSurvivalService))]
|
||||
public class PlayerSurvivalService : EntityComponent, IPlayerSurvivalService
|
||||
public class PlayerSurvivalService : EntityBehavior, IPlayerSurvivalService
|
||||
{
|
||||
public IPlayerSurvivalElement[] Elements { get; set; } = Array.Empty<IPlayerSurvivalElement>();
|
||||
[SerializeReference, SubclassSelector] private IPlayerSurvivalElement[] initialElements = Array.Empty<IPlayerSurvivalElement>();
|
||||
@@ -55,7 +55,7 @@ namespace BITFALL.Player.Survival
|
||||
{
|
||||
element = x,
|
||||
},
|
||||
Target = entity,
|
||||
Target = UnityEntity,
|
||||
Damage = 1,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user