The Attenuation
property of the SpotLight
class defines how the intensity of the light diminishes over distance. It is a float
value that can be adjusted to control the rate at which the light fades as it moves away from the source.
This property is decorated with several attributes:
PropertyAttribute
: Marks this as a property that can be exposed in the editor.MakeDirtyAttribute
: Indicates that changes to this property should mark the object as "dirty," prompting updates or re-renders.RangeAttribute
: Constrains the value between0
and10
, with a step of0.01
. This ensures that the attenuation value remains within a reasonable range for light calculations.DefaultValueAttribute
: Specifies a default value for the property, though the exact default is not detailed here.SourceLocationAttribute
: Provides the source file and line number where this property is defined, useful for debugging and development purposes.