cloneFor method

  1. @override
Component? cloneFor(
  1. Node cloneOwner
)
override

Clones carry the light, sharing the light object like other clone payloads (geometry, materials).

Implementation

@override
Component? cloneFor(Node cloneOwner) {
  if (_usesLightDirection) {
    return DirectionalLightComponent.fromLightDirection(light);
  }
  final localDirection = _localDirection;
  return DirectionalLightComponent._copy(
    light,
    usesLightDirection: false,
    localDirection: localDirection,
  );
}