解决ngui挡住粒子的问题
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class ControlParticle : MonoBehaviour { public int renderQueue = 30000; public bool runOnlyOnce = false; void Start() { Update(); } void Update() { if (renderer != null && renderer.sharedMaterial != null) { renderer.sharedMaterial.renderQueue = renderQueue; } if (runOnlyOnce && Application.isPlaying) { this.enabled = false; } } }
把这段代码加到粒子上,然后调整renderQueue 即可