- Fixed shadows not being cast if the lightsource is outside the sub and the convexhull is not

- Option to change the texture of the "light sphere"
- Added "headlights" to the scooters
This commit is contained in:
Regalis
2016-05-03 00:27:48 +03:00
parent 26608d3f82
commit 03626c997b
9 changed files with 122 additions and 47 deletions
@@ -11,6 +11,8 @@ namespace Barotrauma.Items.Components
private string particles;
private float useState;
private ParticlePrefab.DrawTargetType usableIn;
[HasDefaultValue(0.0f, false)]
@@ -50,6 +52,10 @@ namespace Barotrauma.Items.Components
if (character == null) return false;
if (!character.IsKeyDown(InputType.Aim) || character.Stun>0.0f) return false;
IsActive = true;
useState = 0.1f;
if (character.AnimController.InWater)
{
if (usableIn == ParticlePrefab.DrawTargetType.Air) return true;
@@ -91,12 +97,13 @@ namespace Barotrauma.Items.Components
return true;
}
public override void Draw(SpriteBatch spriteBatch, bool editing = false)
public override void Update(float deltaTime, Camera cam)
{
IsActive = false;
useState -= deltaTime;
if (useState <= 0.0f) IsActive = false;
}
}
}