using System; using NativeEngine; namespace Sandbox; /// /// A directional scene light that is used to mimic sun light in a . Direction is controlled by this objects' . /// [Expose] public sealed class SceneDirectionalLight : SceneLight { /// /// Ambient light color outside of all light probes. /// [Obsolete( "Use AmbientLight Component or World.AmbientLightColor Instead." )] public Color SkyColor { get; set; } internal SceneDirectionalLight( HandleCreationData d ) : base( d ) { } public SceneDirectionalLight( SceneWorld sceneWorld, Rotation rotation, Color color ) : base() { Assert.IsValid( sceneWorld ); using ( var h = IHandle.MakeNextHandle( this ) ) { CSceneSystem.CreateDirectionalLight( sceneWorld, rotation.Backward ); } LightColor = color; } /// /// Control number of shadow cascades /// public int ShadowCascadeCount { get { return lightNative.GetShadowCascades(); } set { lightNative.SetShadowCascades( value ); } } /// /// Set the max distance of the shadow cascade /// public void SetCascadeDistanceScale( float distance ) { lightNative.SetCascadeDistanceScale( distance ); } }