用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:sortinglayer:sortinglayer

SortingLayer 排序层

struct in UnityEngine

Description 描述

SortingLayer allows you to set the render order of multiple sprites easily. There is always a default SortingLayer named “Default” which all sprites are added to initially. Added more SortingLayers to easily control the order of rendering of groups of sprites. Layers can be ordered before or after the default layer.

排序层允许你简单去设置多重精灵的渲染顺序。总有叫“Default”的默认排序层,在这个层里所有的精灵物体在初始化时都会被添加进来。添加更多排序层易于控制精灵的渲染的顺序。层可以被排序到默认层之前或之后。

Static Variables 静态变量

layersReturns all the layers defined in this project.
返回在该工程定义的所有层。

Variables 变量

idThis is the unique id assigned to the layer. It is not an ordered running value and it should not be used to compare with other layers to determine the sorting order.
这是惟一的id分配层。它不是一个有序的运行值,它不应该用于与其它图层来确定排序顺序进行比较。
nameReturns the name of the layer as defined in the TagManager.
返回在TagManager中定义的层的名称。
valueThis is the relative value that indicates the sort order of this layer relative to the other layers.
这是相对值表示该层相对于其他层的排序顺序。

Static Functions 静态函数

GetLayerValueFromIDReturns the final sorting layer value. To determine the sorting order between the various sorting layers, use this method to retrieve the final sorting value and use CompareTo to determine the order.
返回最后的排序层值。在不同的排序层之间确定排序顺序,使用该方法去检索最后的排序值和使用CompareTo 去确定顺序。
GetLayerValueFromNameReturns the final sorting layer value. See Also: GetLayerValueFromID.
返回最后排序层值。请参考GetLayerValueFromID。
IDToNameReturns the unique id of the layer. Will return “<unknown layer>” if an invalid id is given.
返回该层的唯一标识符。如果是给定的无效ID将会返回“<unknown layer>“无法识别的层。
IsValidReturns true if the id provided is a valid layer id.
如果ID是有效层ID返回true。
NameToIDReturns the id given the name. Will return 0 if an invalid name was given.
返回给定名称的ID。如果给定名称无效返回0。
script/unityengine/classes/sortinglayer/sortinglayer.txt · 最后更改: 2016/08/02 05:36 (外部编辑)