Having Trouble Editing a Particle's "Size over Lifetime" via Script (JS)

This might be a dumb question, but I don’t use particles much so I’m very inexperienced with them. I’m trying to edit a Particle System’s ‘Y’ curve for its Size over Lifetime via script, but I’m not sure how I would access it. I want to have this new Y curve displayed in the inspector, just how it would if I used:

var newCurve : AnimationCurve;

The problem is, Size over Lifetime is not an animation curve. Basically, I’m just wondering what type of “curve” I would need to declare it as?

You cannot edit the exact curve via script, either JS or C#. It must be done in the editor UI. Your can only change the curve multiplier, IOW, the curve range, via script.

using UnityEngine;

public class test : MonoBehaviour {
	ParticleSystem ps;
	ParticleSystem.SizeOverLifetimeModule psSol;
	public float psSolY = 5f;
	void Start() {
		ps = GetComponent<ParticleSystem>();
		psSol = ps.sizeOverLifetime;
	void Update() {
		psSol.yMultiplier = psSolY;

While ifurkend’s answer may have been correct in 2017, this answer (and it’s solution) are still getting searched in 2021, where the size over lifetime can definitely be set by an animation curve. See here: