public float startLifetime ;

Description

粒子的初始生命周期。

这是此粒子的总生命周期(以秒为单位)。它由粒子系统在创建粒子时设置。

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