Version: 2021.3
public Vector2 speedRange ;

描述

指定粒子速度如何映射到动画帧。

如果粒子的行进速度低于最小速度,则使用第一帧。如果粒子的行进速度超过最大速度,则使用最终帧。对于所有其他速度,粒子根据速度在最小值和最大值之间的差距来选择帧。

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))] public class ExampleClass : MonoBehaviour { private ParticleSystem ps;

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

var textureSheetAnimation = ps.textureSheetAnimation; textureSheetAnimation.enabled = true; textureSheetAnimation.speedRange = new Vector2(0.9f, 5.0f); } }