Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 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);
     }
 }