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

@@ -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;