李虹霖

 

解决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 即可

 

posted on 2015-07-01 21:51  lol霖  阅读(236)  评论(0编辑  收藏  举报

导航