版本: Unity 6 (6000.0)
语言English
  • C#

ParticleSystem.NoiseModule.rotationAmount

建议更改

成功!

感谢您帮助我们提高 Unity 文档的质量。虽然我们无法接受所有提交,但我们确实阅读了用户提出的每个建议更改,并在适用的情况下进行更新。

关闭

提交失败

由于某些原因,您的建议更改无法提交。请<a>稍后再试</a>。感谢您抽出时间帮助我们提高 Unity 文档的质量。

关闭

取消

切换到手册
public ParticleSystem.MinMaxCurve rotationAmount;

描述

噪声影响粒子旋转的程度,以度/秒为单位。

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public float hSliderValuePositionAmount = 0.0f; public float hSliderValueRotationAmount = 90.0f; public float hSliderValueSizeAmount = 0.0f;

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); } }