swb_base/particles/ParticleCount.cs

A Scene Component that sets the maximum particle count on a ParticleEffect when the entity awakens. It reads Min and Max properties, picks a random value in that inclusive range, and assigns it to the effect's MaxParticles.

using System;

namespace SWB.Base.Particles;

[Group( "SWB Particles" )]
public class ParticleCount : Component
{
	[Property] public int Min { get; set; }
	[Property] public int Max { get; set; }

	protected override void OnAwake()
	{
		var effect = GetComponent<ParticleEffect>();
		var max = Random.Shared.Next( Min, Max + 1 );
		effect.MaxParticles = max;
	}
}