コード例 #1
0
ファイル: LightSource.cs プロジェクト: yaelatletl/Barotrauma
        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);
            }
        }
コード例 #2
0
ファイル: LightSource.cs プロジェクト: shoter/Barotrauma
        public void Remove()
        {
            if (!lightSourceParams.Persistent)
            {
                LightSprite?.Remove();
                OverrideLightTexture?.Remove();
            }

            DeformableLightSprite?.Remove();
            DeformableLightSprite = null;

            lightVolumeBuffer?.Dispose();
            lightVolumeBuffer = null;

            lightVolumeIndexBuffer?.Dispose();
            lightVolumeIndexBuffer = null;

            GameMain.LightManager.RemoveLight(this);
        }