main
Access the main Particle System settings.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.ParticleSystemModule
public ParticleSystem.MainModule main { get; }
Remarks
This module provides access to the general settings that are displayed above all of the other module settings in the Particle System's Inspector window.
Particle System modules do not need to be reassigned back to the system; they are interfaces and not independent objects.
Examples
// Create a Particle System// Set a 5 second start delay for the system, and a 2 second lifetime for each particleusing UnityEngine;using System.Collections;[RequireComponent(typeof(ParticleSystem))]public class ExampleClass : MonoBehaviour{ void Start() { ParticleSystem ps = GetComponent<ParticleSystem>(); var main = ps.main; main.startDelay = 5.0f; main.startLifetime = 2.0f; }}