解决骨骼动画与ngui层级关系

来源:互联网 发布:php手册安卓版 编辑:程序博客网 时间:2024/05/16 15:52

纠结了接近两天时间,终于找到了办法,在网上找到了答案!


恍然大悟:

不管是什么内容,都要通过draw call来渲染,我们更改下渲染队列的顺序就行了,首先我们要知道
ngui的panel默认的Render Queue是3000
打开UIPanle.cs文件,可以找到:
/// <summary>/// Render queue used by the panel. The default value of '3000' is the equivalent of "Transparent"./// This property is only used if 'renderQueue' is set to something other than "Automatic"./// </summary>public int startingRenderQueue = 3000;

在ngui的read me可以找到
3.3.6 (previously 3.0.8 f7)- FIX: UIPanel's "explicit" render queue option should now work correctly.- FIX: UITweener.Play should behave better with duration of 0.- FIX: NGUITools.FindCamera will prioritize the Main Camera over others (fix for Unity Water).- FIX: Null exception fix in UIKeyBinding.
所以,现在panle的Redn Queue是可以手动修改的,如下


spine默认的Render Queue是2000
所以我们这样
分好层,不同层放入不同的panel
设置天气层panel1  Render Queue = 1000
设置宠物    pet       Render Queue  = 2000;
显示在宠物上层的场景放入pane2  Render Queue  = 3000;

这样,就实现了背景,人物,前景,依次渲染

0 0
原创粉丝点击