using UnityEngine; public class ReplayParticleSystems : MonoBehaviour { // 调用这个方法来重新播放所有子物体上的粒子系统 public void ReplayAllParticleSystems() { foreach (Transform child in transform) { ParticleSystem particleSystem = child.GetComponent(); if (particleSystem != null) { particleSystem.Stop(); // 停止粒子系统 particleSystem.Play(); // 重新播放粒子系统 } } } }