public LightSource(LightSourceParams lightSourceParams) : this(Vector2.Zero, 100.0f, Color.White, null) { this.lightSourceParams = lightSourceParams; lightSourceParams.Persistent = true; if (lightSourceParams.DeformableLightSpriteElement != null) { DeformableLightSprite = new DeformableSprite(lightSourceParams.DeformableLightSpriteElement); } }
public LightSource(XElement element) : this(Vector2.Zero, 100.0f, Color.White, null) { lightSourceParams = new LightSourceParams(element); CastShadows = element.GetAttributeBool("castshadows", true); if (lightSourceParams.DeformableLightSpriteElement != null) { DeformableLightSprite = new DeformableSprite(lightSourceParams.DeformableLightSpriteElement); } }
public LightSource(Vector2 position, float range, Color color, Submarine submarine, bool addLight = true) { hullsInRange = new List <ConvexHullList>(); this.ParentSub = submarine; this.position = position; lightSourceParams = new LightSourceParams(range, color); CastShadows = true; texture = LightTexture; diffToSub = new Dictionary <Submarine, Vector2>(); if (addLight) { GameMain.LightManager.AddLight(this); } }