Renderer.lightmapIndex 光照贴图索引
var lightmapIndex : int
Description描述
The index of the lightmap applied to this renderer.
应用到该渲染器的光照贴图的索引。
The index refers to lightmaps array in LightmapSettings class. A value of 255 means no lightmap has been assigned, which is the default. A value of 254 is internally used for objects, that have their scale in lightmap set to 0, so behave as lightmapped, but don't have a lightmap assigned. The index can't be larger than 253.
索引是参考在LightmapSettings类的lightmaps数组。255的值意思是没有光照贴图被指定,这个值是默认的。254的值是物体内部使用的,有它们在光照贴图比例设置为0,因此表现为已应用了光照贴图,但是并没有光照贴图被指定。索引不能比253大。我总结一下,上面原文翻译的不太通顺
默认值为255,不使用光照贴图的意思,254是内部用,能使用的值是253~0。
A scene can have several lightmaps stored in it, and Renderer can use one of those lightmaps. This makes it possible to use the same material on multiple objects, while each object can refer to a different lightmap or different portion of the same lightmap.
一个场景可以储存多个光照贴图,并且渲染器可以使用这些光照贴图其中之一。这使得有可能在多个物体使用相同的材质,虽然每个物体可以引用不同的光照贴图或同一光照的不同部分。
参见: LightmapSettings 类, lightmapTilingOffset 属性