Version: 2022.3
public float startLifetime ;

描述

粒子的初始生命周期。

这是此粒子的总生命周期(以秒为单位)。当粒子系统第一次生成粒子时,会设置此值。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { ParticleSystem.Particle particle = new ParticleSystem.Particle();

// Calculate how long the particle has been alive. float timeAlive = particle.startLifetime - particle.lifetime; } }