Version: 2021.1
public Vector2 ringBufferLoopRange ;

描述

ParticleSystem.MainModule.ringBufferMode 设置为循环时,此值定义粒子生命周期中的循环比例。

这样可以使用在粒子生命周期内应用的其他粒子属性,例如 SizeOverLifetime。如果系统必须替换粒子,粒子将从当前时期开始播放,直到整个生命周期结束。然后,会将其删除。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private ParticleSystem ps;

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

void Update() { var main = ps.main; main.ringBufferLoopRange = new Vector2(0.1f, 0.6f); } }