This commit is contained in:
Mister_Nebula 2021-05-07 19:23:24 +01:00
parent b1b35c58f8
commit e2f1d63d6b
2 changed files with 4 additions and 8 deletions

View File

@ -12,7 +12,6 @@ namespace QSB.Animation.Player.Thrusters
private float _belowMaxThrustScalar = 1f;
private MeshRenderer _thrusterRenderer;
private Vector3 _thrusterFilter;
private bool _thrustersFiring;
private float _baseLightRadius;
private float _currentScale;
@ -37,7 +36,6 @@ namespace QSB.Animation.Player.Thrusters
{
_thrusterRenderer = GetComponent<MeshRenderer>();
_thrusterFilter = OWUtilities.GetShipThrusterFilter(_thruster);
_thrustersFiring = false;
_baseLightRadius = _light.range;
_currentScale = 0f;
_thrusterRenderer.enabled = false;
@ -68,15 +66,15 @@ namespace QSB.Animation.Player.Thrusters
_currentScale = 0f;
_scaleSpring.ResetVelocity();
}
if ((!_thrustersFiring) && _currentScale <= 0.001f)
if (_currentScale <= 0.001f)
{
_currentScale = 0f;
_scaleSpring.ResetVelocity();
}
transform.localScale = Vector3.one * _currentScale;
_light.range = _baseLightRadius * _currentScale;
_thrusterRenderer.enabled = (_currentScale > 0f);
_light.enabled = (_currentScale > 0f);
_thrusterRenderer.enabled = _currentScale > 0f;
_light.enabled = _currentScale > 0f;
}
private float GetThrustFraction() => Vector3.Dot(_attachedPlayer.JetpackAcceleration.LocalAcceleration, _thrusterFilter);

View File

@ -57,11 +57,9 @@ namespace QSB.Animation.Player.Thrusters
}
}
private static void CreatePlayerParticlesController(GameObject root)
{
private static void CreatePlayerParticlesController(GameObject root) =>
// TODO : Implement this. (Footsteps / Landing)
Object.Destroy(root.GetComponent<PlayerParticlesController>());
}
private static void CreateThrusterParticlesBehaviour(GameObject root, PlayerInfo player)
{