访问粒子系统的光源模块。
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public Light lightPrefab;
void Start() {
ParticleSystem ps = GetComponent<ParticleSystem>();
var lights = ps.lights;
lights.enabled = true;
lights.ratio = 0.5f;
lights.light = lightPrefab;
}
}