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.
通常、ライトはエディターで作成しますが、スクリプトからライトを作成したい場合があります。
using UnityEngine;
public class Example : MonoBehaviour { void Start() { // Make a game object GameObject lightGameObject = new GameObject("The Light");
// Add the light component Light lightComp = lightGameObject.AddComponent<Light>();
// Set color and position lightComp.color = Color.blue;
// Set the position (or any transform property) lightGameObject.transform.position = new Vector3(0, 5, 0); } }
areaSize | The size of the area light (Editor only). |
bakingOutput | This property describes the output of the last Global Illumination bake. |
bounceIntensity | バウンスライトの強さを定義する乗数です。 |
boundingSphereOverride | Bounding sphere used to override the regular light bounding sphere during culling. |
color | ライトのカラーを設定する。 |
colorTemperature | The color temperature of the light. Correlated Color Temperature (abbreviated as CCT) is multiplied with the color filter when calculating the final color of a light source. The color temperature of the electromagnetic radiation emitted from an ideal black body is defined as its surface temperature in Kelvin. White is 6500K according to the D65 standard. A candle light is 1800K and a soft warm light bulb is 2700K. If you want to use colorTemperature, GraphicsSettings.lightsUseLinearIntensity and Light.useColorTemperature has to be enabled. Additional resources: GraphicsSettings.lightsUseLinearIntensity, GraphicsSettings.useColorTemperature. |
commandBufferCount | このライトを設定するコマンドバッファーの数 (Read Only) |
cookie | ライトで投影するクッキーを設定する。 |
cookieSize | ディレクショナルライトのクッキーのサイズ |
cullingMask | This is used to light certain objects in the Scene selectively. |
dilatedRange | The Light.range property describes the range of each point on the light. However, area lights consist of several light-emitting points, and so the effective range is a bit larger, and depends on the size of the area light. This property returns this larger range. Use this property to find whether a given world-space point will be lit by the area light. If not an area light, then returns the same value as Light.range. |
flare | ライトに フレア を使用する。 |
innerSpotAngle | The angle of the spot light's inner cone in degrees. |
intensity | ライトの強度はライトのカラーで乗算されます。 |
layerShadowCullDistances | Per-light, per-layer shadow culling distances. Directional lights only. |
lightmapBakeType | This property describes what part of a light's contribution can be baked (Editor only). |
lightShadowCasterMode | Allows you to override the global Shadowmask Mode per light. Only use this with render pipelines that can handle per light Shadowmask modes. Incompatible with the legacy renderers. |
range | The range of each point of the light. Since area lights have a light emitting surface instead of a single point, the cumulative range of the light is larger than this property. This larger range can be read from the Light.dilatedRange property. For non-area lights, Light.range and Light.dilatedRange return the same value. |
renderingLayerMask | Determines which rendering LayerMask this Light affects. |
renderMode | レンダリングするモードを設定する。 |
shadowAngle | Controls the amount of artificial softening applied to the edges of shadows cast by directional lights (Editor only). |
shadowBias | シャドウマッピングのバイアス |
shadowCustomResolution | シャドウマップのカスタムの解像度。 |
shadowMatrixOverride | Matrix that overrides the regular light projection matrix during shadow culling. Unity uses this matrix if you set Light.useShadowMatrixOverride to true. |
shadowNearPlane | シャドウ視錐台に使用する近い方の平面の値 |
shadowNormalBias | ノーマルベースバイアスのシャドウマッピング |
shadowRadius | Controls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light (Editor only). |
shadowResolution | The resolution of the shadow map. |
shadows | どのようにこのライトが影を落とすか。 |
shadowStrength | 影の強さを設定します。 |
spotAngle | The angle of the spot light's cone in degrees. |
type | ライトの種類を設定する。 |
useBoundingSphereOverride | Set to true to override light bounding sphere for culling. |
useColorTemperature | Set to true to use the color temperature. |
useShadowMatrixOverride | Set to true to enable custom matrix for culling during shadows. |
useViewFrustumForShadowCasterCull | Whether to cull shadows for this Light when the Light is outside of the view frustum. |
AddCommandBuffer | 指定された場所で実行されるようコマンドバッファを追加します。 |
AddCommandBufferAsync | Adds a command buffer to the GPU's async compute queues and executes that command buffer when graphics processing reaches a given point. |
GetCommandBuffers | 指定された場所で実行されるようにコマンドバッファを取得します。 |
RemoveAllCommandBuffers | このライトに設定するすべてのコマンドバッファーを削除します。 |
RemoveCommandBuffer | 指定された場所で実行からコマンドバッファを削除します。 |
RemoveCommandBuffers | 指定された場所で実行からコマンドバッファを削除してください。 |
Reset | Revert all light parameters to default. |
SetLightDirty | Sets a light dirty to notify the light baking backends to update their internal light representation (Editor only). |
enabled | 有効であれば更新され、無効であれば更新されません。 |
isActiveAndEnabled | Reports whether a GameObject and its associated Behaviour is active and enabled. |
gameObject | このコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。 |
tag | ゲームオブジェクトのタグ |
transform | The Transform attached to this GameObject. |
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | オブジェクト名 |
BroadcastMessage | ゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。 |
CompareTag | Checks the GameObject's tag against the defined tag. |
GetComponent | Gets a reference to a component of type T on the same GameObject as the component specified. |
GetComponentInChildren | Gets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject. |
GetComponentInParent | Gets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject. |
GetComponents | Gets references to all components of type T on the same GameObject as the component specified. |
GetComponentsInChildren | Gets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject. |
GetComponentsInParent | Gets references to all components of type T on the same GameObject as the component specified, and any parent of the GameObject. |
SendMessage | ゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
SendMessageUpwards | ゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します |
TryGetComponent | Gets the component of the specified type, if it exists. |
GetInstanceID | Gets the instance ID of the object. |
ToString | Returns the name of the object. |
Destroy | Removes a GameObject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
FindAnyObjectByType | Retrieves any active loaded object of Type type. |
FindFirstObjectByType | Retrieves the first active loaded object of Type type. |
FindObjectsByType | Retrieves a list of all loaded objects of Type type. |
Instantiate | original のオブジェクトをクローンします |
bool | オブジェクトが存在するかどうか |
operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |