class in UnityEngine/Inherits from: Behaviour
Script interface for light components.
灯光组件的脚本接口。
Use this to control all aspects of Unity's lights. The properties are an exact match for the values shown in the Inspector.
使用该属性控制Unity灯光的所有方面。该属性准确匹配面板中的值。
Usually lights are just created in the editor but sometimes you want to create a light from a script:
通常灯光仅在编辑器中创建但是有时你想在脚本中创建灯光:
JavaScript:
function Start () { // Make a game object var lightGameObject : GameObject = new GameObject("The Light"); // Add the light component var lightComp = lightGameObject.AddComponent.<Light>(); // Set color and position lightComp.color = Color.blue; // Set the position (or any transform property) lightGameObject.transform.position = Vector3(0, 5, 0); }
C#:
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Start() { GameObject lightGameObject = new GameObject("The Light"); Light lightComp = lightGameObject.AddComponent<Light>(); lightComp.color = Color.blue; lightGameObject.transform.position = new Vector3(0, 5, 0); } }
alreadyLightmapped | Has the light already been lightmapped. 是否已经烘培灯光贴图。 |
areaSize | The size of the area light. Editor only. 灯光区域的大小。仅编辑器中。 |
bounceIntensity | The multiplier that defines the strength of the bounce lighting. 定义的反射光的强度的倍数。 |
color | The color of the light. 灯光的颜色。 |
commandBufferCount | Number of command buffers set up on this light (Read Only). 在该光照上建立的命令缓存的数量(只读)。 |
cookie | The cookie texture projected by the light. 灯光的纹理蒙版投影。 |
cookieSize | The size of a directional light's cookie. 平行光的蒙版的大小。 |
cullingMask | This is used to light certain objects in the scene selectively. 该属性用于在场景中选择性的照亮某些对象。 |
flare | The flare asset to use for this light. 使用该光源的光晕资源。 |
intensity | The Intensity of a light is multiplied with the Light color. 光照强度与光照颜色相乘。 |
range | The range of the light. 光照的范围。 |
script/unityengine/classes/light/light.txt · 最后更改: 2016/08/02 05:30 (外部编辑)
除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 3.0 Unported |