Lighting fixes & teleporting characters to sub
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user