public void SetLight(DataSources dataSource, short lightIndex) { switch (dataSource) { case DataSources.Primary: if (lightIndex == NativeObject.PrimaryLightsourceIndex || NativeObject.Primary.Texture.UsesLandscapeCollection()) { // Light is not different, so exit return; } NativeObject.PrimaryLightsourceIndex = lightIndex; PrimarySurface.ApplyLight(); break; case DataSources.Secondary: if (lightIndex == NativeObject.SecondaryLightsourceIndex || NativeObject.Secondary.Texture.UsesLandscapeCollection()) { // Light is not different, so exit return; } NativeObject.SecondaryLightsourceIndex = lightIndex; SecondarySurface.ApplyLight(); break; case DataSources.Transparent: if (lightIndex == NativeObject.TransparentLightsourceIndex || NativeObject.Transparent.Texture.UsesLandscapeCollection()) { // Light is not different, so exit return; } NativeObject.TransparentLightsourceIndex = lightIndex; TransparentSurface.ApplyLight(innerLayer: !NativeObject.HasLayeredTransparentSide(ParentLevel.Level)); break; default: return; } }