Version: 2017.2

描述

访问主粒子系统设置。

从这个特殊的主模块,可访问 ParticleSystem 的 Inspector 中显示在所有其他模块上方的常规设置。

// Create a particle system
// Set a 5 second start delay for the system, and a 2 second lifetime for each particle
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { ParticleSystem ps = GetComponent<ParticleSystem>(); var main = ps.main;

main.startDelay = 5.0f; main.startLifetime = 2.0f; } }