Version: 2019.3
LanguageEnglish
  • C#

ParticleSystem.NoiseModule.sizeAmount

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public ParticleSystem.MinMaxCurve sizeAmount;

Description

How much the noise affects the particle sizes, applied as a multiplier on the size of each particle.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public float hSliderValuePositionAmount = 0.0f; public float hSliderValueRotationAmount = 0.0f; public float hSliderValueSizeAmount = 0.5f;

void Start() { ps = GetComponent<ParticleSystem>();

var noise = ps.noise; noise.enabled = true;

var psr = GetComponent<ParticleSystemRenderer>(); psr.material = new Material(Shader.Find("Sprites/Default")); // this material renders a square billboard, so we can see the rotation }

void Update() { var noise = ps.noise; noise.enabled = enabled; noise.positionAmount = hSliderValuePositionAmount; noise.rotationAmount = hSliderValueRotationAmount; noise.sizeAmount = hSliderValueSizeAmount; }

void OnGUI() { GUI.Label(new Rect(25, 80, 100, 30), "Position Amount"); GUI.Label(new Rect(25, 120, 100, 30), "Rotation Amount"); GUI.Label(new Rect(25, 160, 100, 30), "Size Amount");

hSliderValuePositionAmount = GUI.HorizontalSlider(new Rect(135, 85, 100, 30), hSliderValuePositionAmount, 0.0f, 5.0f); hSliderValueRotationAmount = GUI.HorizontalSlider(new Rect(135, 125, 100, 30), hSliderValueRotationAmount, 0.0f, 180.0f); hSliderValueSizeAmount = GUI.HorizontalSlider(new Rect(135, 165, 100, 30), hSliderValueSizeAmount, 0.0f, 1.0f); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961