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

ParticleSystem.LimitVelocityOverLifetimeModule.limitZ

建议更改

成功!

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

关闭

提交失败

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

关闭

取消

切换到手册

描述

Z 轴的最大速度曲线。

其他资源:MinMaxCurve

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps; public float hSliderValueSpeedX = 0.0f; public float hSliderValueSpeedY = 0.0f; public float hSliderValueSpeedZ = 0.0f; public float hSliderValueDampen = 0.1f;

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

var limitVelocityOverLifetime = ps.limitVelocityOverLifetime; limitVelocityOverLifetime.enabled = true; limitVelocityOverLifetime.separateAxes = true; }

void Update() { var limitVelocityOverLifetime = ps.limitVelocityOverLifetime; limitVelocityOverLifetime.limitX = hSliderValueSpeedX; limitVelocityOverLifetime.limitY = hSliderValueSpeedY; limitVelocityOverLifetime.limitZ = hSliderValueSpeedZ; limitVelocityOverLifetime.dampen = hSliderValueDampen; }

void OnGUI() { GUI.Label(new Rect(25, 40, 100, 30), "Speed Limit X"); GUI.Label(new Rect(25, 80, 100, 30), "Speed Limit Y"); GUI.Label(new Rect(25, 120, 100, 30), "Speed Limit Z"); GUI.Label(new Rect(25, 160, 100, 30), "Dampen");

hSliderValueSpeedX = GUI.HorizontalSlider(new Rect(135, 45, 100, 30), hSliderValueSpeedX, 0.0f, 2.0f); hSliderValueSpeedY = GUI.HorizontalSlider(new Rect(135, 85, 100, 30), hSliderValueSpeedY, 0.0f, 2.0f); hSliderValueSpeedZ = GUI.HorizontalSlider(new Rect(135, 125, 100, 30), hSliderValueSpeedZ, 0.0f, 2.0f); hSliderValueDampen = GUI.HorizontalSlider(new Rect(135, 165, 100, 30), hSliderValueDampen, 0.0f, 1.0f); } }