以åã®æ稿ã§
NGUIではないオブジェクトをNGUIの手前に描画する方法 - 太郎Work
ãã®ãããªè¨äºãæ¸ãã¾ããããParticleSystemãã¡ãã·ã¥ãæåã«æã£ã¦ãããå ´åãä»»æã®å ´æã«æã¿ããå ´åã¯é常ã«ããã©ãã§ããã
ãã¯ãNGUIã®depthã§ç®¡çããããªã£ãã®ã§ã³ã³ãã¼ãã³ããä½æãã¾ããã
注æï¼ï¼NGUI3.xç¨ã§ã
tarob19/UIUnityRenderer · GitHub
å®è¡ä¾
å¾ãããdepth0, depth2, depth4ã§æå®ããUITextureã«ParticleSystemãå
¥ããå ´åã®å®è¡çµæã§ã
ç´æçã«ä»»æã®ã¬ã¤ã¤ã¼ã«Particleã表示ã§ãã¦ããã®ããããã¨æãã¾ãã
ã³ã³ãã¼ãã³ãã«æçµçãªRenderQueueã®ç¢ºèªãã§ããããã«ãã¾ããã
ãã¡ããNGUIã®DrawCallToolã§ãè¦ããã¾ãã
depth = -1 ä¸çªè£å´
depth = 1
depth = 3
depth = 5 æåé¢
ParticleSystemã¨åãGameObjectã«ã¢ã¿ãããã¦UIPanel以ä¸ã«å
¥ããã¨UIWidgetã®depthã§ç®¡çã§ããããã«ãªãã¾ãã
使ãããæ¹ã¯ã©ããããã ã使ã£ããã¨ã«ãã責任ã¯ä¸åè² ãã¾ãã
以ä¸è©³ç´°
GetComponentã§Rendererãåå¾ãã¦NGUIã«Widgetã¨ãã¦ç»é²ãã¦ãã¾ãã
OnFillã§ç»é¢å¤ã«ããã¼ã®ã¡ãã·ã¥æ
å ±ãã»ãããã¦ãããã¨ã§ãããªãã1drawCallçºçããããã«ãã¦ãã¾ãã
ãã ããç»é¢å¤ã«æç»ãããããUnityã®æ¹ã§ã«ãªã³ã°ãããã®ã§ç¡é§ãªDrawCallã¯çºçããRendererã®DrawCallã®ã¿ãªã®ã§ãå®å¿ä¸ããã
depthãæä½ããã¨UIDrawCallãæ¸ãæããã®ã§ãã®å¤ãã³ãã¼ããMaterialã«ã»ãããã¦ãã¾ãã
ããããããã©ã«ãã§ã¯ããã¯å®è¡æã®ã¿é©ç¨ããããã«ãã¦ãã¾ãã
ããã¯ãSharedMaterialãæ¸ãæããã¨Projectã®ãããªã¢ã«æ
å ±ãéææ¸ãæãããããã¼ã¸ã§ã³ç®¡çããã¦ããå ´åUIPanelãæä½ãã度ã«å¤æ´ç¹ã¨ãã¦ä¸ãã£ã¦ãã¾ãããã§ãã
ãããªãã¨ã¯æ°ã«ããªãorå®è¡åã«ç¢ºèªãããã¨ããæ¹ã¯UseSharedMaterialã«ãã§ãã¯ãå ¥ããã¨Rendererã®ãããªã¢ã«ãç´æ¥æä½ããããã«ãªãã¾ãã
ã¨ããããè¤æ°ãããªã¢ã«ã«å¯¾å¿ãã¾ãããæ¬å½ã«åããã¯åããã¾ããã
UIWidgetã®mPlayModeããã¾ãåããªãã£ãã®ã§æ¯ãã¬ã¼ã ãã§ãã¯ã«ãªã£ã¦ãã¾ãã¾ããããã
試è¡é¯èª¤ã§çµæ§è¦å´ãããã©æçµçã«è¯ãæãã«ãªã£ã¦ããã£ãã