粒子系统光源模块的脚本接口。
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; } }