sorting order 和sorting layer

根据unity的api文档

https://docs.unity3d.com/ScriptReference/Renderer-sortingOrder.html

Renderer's order within a sorting layer.

You can group GameObjects into layers in their SpriteRenderer component. This is called the SortingLayer. The sorting order decides what priority each GameObject has to the Renderer within each Sorting Layer. The lower the number you give it, the further back the GameObject appears. The higher the number, the closer the GameObject looks to the Camera. This is very effective when creating 2D scroller games, as you may want certain GameObjects on the same layer but certain parts to appear in front of others, for example, layering clouds and making them appear in front of the sky.

sorting layer所使用的对象应该是gameobject的renderer

https://www.jianshu.com/p/0341f0ab9020

 

另外:renderqueue的权重是最高的,仅次于camera的depth

posted @ 2020-11-15 16:32  钢与铁  阅读(285)  评论(0编辑  收藏  举报