Lighting fixes & teleporting characters to sub

This commit is contained in:
Regalis11
2015-12-06 16:07:25 +02:00
parent 09588e548d
commit 40fb8d803d
11 changed files with 66 additions and 27 deletions
+10 -1
View File
@@ -19,6 +19,8 @@ namespace Barotrauma.Lights
private Texture2D texture;
public Entity Submarine;
private Vector2 position;
public Vector2 Position
{
@@ -32,6 +34,11 @@ namespace Barotrauma.Lights
}
}
public Vector2 WorldPosition
{
get { return (Submarine == null) ? position : position + Submarine.Position; }
}
public static Texture2D LightTexture
{
get
@@ -64,10 +71,12 @@ namespace Barotrauma.Lights
}
}
public LightSource(Vector2 position, float range, Color color)
public LightSource(Vector2 position, float range, Color color, Submarine submarine)
{
hullsInRange = new List<ConvexHull>();
this.Submarine = submarine;
this.position = position;
this.range = range;
this.color = color;