Throwing Knife Added

This commit is contained in:
CortexCore
2023-10-25 17:26:42 +08:00
parent 3e39e627bc
commit c5f638d9d2
31 changed files with 2432 additions and 310 deletions

View File

@@ -20,6 +20,11 @@ namespace BITKit.Entities.Movement
public Vector3 GroundVelocity { get; }
public Vector3 AngularVelocity { get; }
public bool IsGrounded { get; }
[Inject(true)]
private IHealth health;
public void SyncMovement(Vector3 velocity, Vector3 position, Quaternion rotation, bool isGrounded)
{
}
@@ -37,6 +42,20 @@ namespace BITKit.Entities.Movement
}
public event Action<object> OnCommand;
public override void OnAwake()
{
base.OnAwake();
if (health is not null)
{
health.OnSetAlive += OnSetAlive;
}
}
private void OnSetAlive(bool obj)
{
rigidbody.isKinematic = !obj;
}
public override void OnFixedUpdate(float deltaTime)
{
rigidbody.MovePosition(rigidbody.position + Velocity * deltaTime