This commit is contained in:
CortexCore
2023-11-15 23:55:06 +08:00
parent 5446067f91
commit 70247f0242
82 changed files with 3271 additions and 579 deletions

View File

@@ -58,13 +58,14 @@ namespace BITKit.Vehicles
private readonly ValidHandle highSpeedHandle = new();
private IUnityEntity _unityEntity;
[Inject]
[Inject(true)]
private IHealth _health;
public override void OnAwake()
{
base.OnAwake();
_health.OnSetAlive += OnSetAlive;
if (_health is not null)
_health.OnSetAlive += OnSetAlive;
}
private void OnSetAlive(bool obj)
@@ -122,7 +123,7 @@ namespace BITKit.Vehicles
{
trans.localEulerAngles = new Vector3(torque * Time.deltaTime, steelAngle, 0);
});
if (steeringWheel is not null)
if (steeringWheel)
steeringWheel.localEulerAngles = new Vector3(0, 0, steelAngle);
x.wheels.ForEach(wheelCollider => { wheelCollider.steerAngle = steel; });
break;