Home>
I want to solve

ParticleSystem.Burst burst
burst + = 100
Now I want to increase the number of particles by 100, but I get an error with "+=".

problem

error CS0019: Operator'+ ='cannot be applier to operands of type'ParticleSYstem.MinMaxCurve'and'int'

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test: MonoBehaviour
{
    public ParticleSystem particle1;
    ParticleSystem.Burst burst;
    // Start is called before the first frame update
    void Start ()
    {
        burst.count = 500;
    }
    // Update is called once per frame
    void Update ()
    {
        Burst ();
    }
    public void Burst () // change the number of particles
    {
        if (Input.GetKeyDown (KeyCode.A))
        {
            burst.count + = 100;// error occurs
            particle1.emission.SetBurst (0, burst);
        }
    }
}
Thoughts

CS0019 seems to be an error that the operator cannot be used, so I think that'+ ='cannot be used in ParticleSystem.burst.

burst.count seems to be a short type, so I think that integer values ​​can be used and it can be calculated with'+ =', but I'm not sure here.
Do I need to use a method that increases values ​​other than'+ ='?

unity official conference
https://docs.unity3d.com/ja/current/ScriptReference/ParticleSystem.Burst-ctor.html