copyWith method

LightingConfig copyWith({
  1. double? radius,
  2. Color? color,
  3. bool? withPulse,
  4. bool? useComponentAngle,
  5. double? pulseVariation,
  6. double? pulseSpeed,
  7. Curve? pulseCurve,
  8. double? blurBorder,
  9. LightingType? type,
  10. Vector2? align,
  11. LightingMode? mode,
  12. LightFalloff? falloff,
  13. double? innerRadius,
  14. double? intensity,
  15. BlendMode? additiveBlendMode,
  16. LightFlicker? flicker,
  17. bool? castShadows,
})

Returns a copy with the given fields replaced.

All fields are preserved, including align, mode and falloff.

Implementation

LightingConfig copyWith({
  double? radius,
  Color? color,
  bool? withPulse,
  bool? useComponentAngle,
  double? pulseVariation,
  double? pulseSpeed,
  Curve? pulseCurve,
  double? blurBorder,
  LightingType? type,
  Vector2? align,
  LightingMode? mode,
  LightFalloff? falloff,
  double? innerRadius,
  double? intensity,
  BlendMode? additiveBlendMode,
  LightFlicker? flicker,
  bool? castShadows,
}) {
  return LightingConfig(
    radius: radius ?? this.radius,
    color: color ?? this.color,
    withPulse: withPulse ?? this.withPulse,
    useComponentAngle: useComponentAngle ?? this.useComponentAngle,
    pulseVariation: pulseVariation ?? this.pulseVariation,
    pulseSpeed: pulseSpeed ?? this.pulseSpeed,
    pulseCurve: pulseCurve ?? this.pulseCurve,
    blurBorder: blurBorder ?? this.blurBorder,
    type: type ?? this.type,
    align: align ?? this.align,
    mode: mode ?? this.mode,
    falloff: falloff ?? this.falloff,
    innerRadius: innerRadius ?? this.innerRadius,
    intensity: intensity ?? this.intensity,
    additiveBlendMode: additiveBlendMode ?? this.additiveBlendMode,
    flicker: flicker ?? this.flicker,
    castShadows: castShadows ?? this.castShadows,
  );
}