initFrom method

  1. @override
void initFrom(
  1. Behaviour oldBehaviour
)
override

Called when this behaviour should be initialized from an old behaviour.

Implementation

@override
void initFrom(Behaviour oldBehaviour) {
  if (oldBehaviour is ParticleBehaviour) {
    particles = oldBehaviour.particles;

    // keep old image if waiting for a new one
    if (options.image != null && _particleImage == null) {
      _particleImage = oldBehaviour._particleImage;
      _particleImageSrc = oldBehaviour._particleImageSrc;
    }

    onOptionsUpdate(oldBehaviour.options);
  }
}