// Start is called before the first frame update
    void Start()
    {
        WeightedRandomizer <Color> m_Randomizer = new WeightedRandomizer <Color>();

        m_Randomizer.AddValue(Color.black, 1.0f);
        m_Randomizer.AddValue(Color.blue, 1.0f);
        m_Randomizer.AddValue(Color.green, 1.0f);
        m_Randomizer.AddValue(Color.red, 1.0f);
        m_Randomizer.AddValue(Color.white, 50.0f);

        float minX = m_X_Min;
        float maxX = m_X_Max;
        float minY = m_Y_Min;
        float maxY = m_Y_Max;

        //getting camera bounds
        if (m_Camera)
        {
            float halfSize = m_Camera.orthographicSize;
            float ratio    = m_Camera.aspect;

            minY = -halfSize;
            maxY = halfSize;

            minX = -halfSize * ratio;
            maxX = halfSize * ratio;
        }


        //generate sprites
        m_Sprites = new List <SpriteData>(m_SpritesCount);

        for (int i = 0; i < m_SpritesCount; i++)
        {
            var newSprite = new SpriteData();

            newSprite.m_Coords.x    = MathHelpers.Random_Float(minX, maxX);
            newSprite.m_Coords.y    = MathHelpers.Random_Float(minY, maxY);
            newSprite.m_Color       = m_Randomizer.GetRandomValue();
            newSprite.m_HorLeft     = MathHelpers.Random_CheckChance(0.5f);
            newSprite.m_VerUp       = MathHelpers.Random_CheckChance(0.5f);
            newSprite.m_SpeedMult   = MathHelpers.Random_Factor();
            newSprite.m_SpeedMult   = newSprite.m_SpeedMult * newSprite.m_SpeedMult * newSprite.m_SpeedMult * newSprite.m_SpeedMult * newSprite.m_SpeedMult * newSprite.m_SpeedMult;
            newSprite.m_SpriteIndex = MathHelpers.Random_Int(0, 1);
            newSprite.m_Angle       = MathHelpers.Random_Angle();

            newSprite.m_Scale = Interpolation.Linear(0.5f, 2.0f, (Mathf.Pow(MathHelpers.Random_Factor(), 3.0f)));

            m_Sprites.Add(newSprite);
        }
    }