Version: 2019.2

Light

class in UnityEngine

/

継承:Behaviour

マニュアルに切り替える

説明

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); } }

変数

areaSizeThe size of the area light.
bakingOutputThis property describes the output of the last Global Illumination bake.
bounceIntensityバウンスライトの強さを定義する乗数です。
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. Candle light is 1800K. If you want to use lightsUseCCT, lightsUseLinearIntensity has to be enabled to ensure physically correct output. See Also: GraphicsSettings.lightsUseLinearIntensity, GraphicsSettings.lightsUseCCT.
commandBufferCountこのライトを設定するコマンドバッファーの数 (Read Only)
cookieライトで投影するクッキーを設定する。
cookieSizeディレクショナルライトのクッキーのサイズ
cullingMaskThis is used to light certain objects in the Scene selectively.
flareライトに フレア を使用する。
intensityライトの強度はライトのカラーで乗算されます。
layerShadowCullDistancesPer-light, per-layer shadow culling distances.
lightmapBakeTypeThis property describes what part of a light's contribution can be baked.
lightShadowCasterModeAllows 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ライトの大きさを設定する。
renderModeレンダリングするモードを設定する。
shadowAngleControls the amount of artificial softening applied to the edges of shadows cast by directional lights.
shadowBiasシャドウマッピングのバイアス
shadowCustomResolutionシャドウマップのカスタムの解像度。
shadowNearPlaneシャドウ視錐台に使用する近い方の平面の値
shadowNormalBiasノーマルベースバイアスのシャドウマッピング
shadowRadiusControls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light.
shadowResolutionThe resolution of the shadow map.
shadowsどのようにこのライトが影を落とすか。
shadowStrength影の強さを設定します。
spotAngleスポットライトのアングルの角度を設定する。
typeライトの種類を設定する。

Public 関数

AddCommandBuffer指定された場所で実行されるようコマンドバッファを追加します。
AddCommandBufferAsyncAdds 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指定された場所で実行からコマンドバッファを削除してください。
ResetRevert all light parameters to default.
SetLightDirtySets a light dirty to notify the light baking backends to update their internal light representation.

継承メンバー

変数

enabled有効であれば更新され、無効であれば更新されません。
isActiveAndEnabledHas the Behaviour had active and enabled called?
gameObjectこのコンポーネントはゲームオブジェクトにアタッチされます。コンポーネントはいつもゲームオブジェクトにアタッチされています。
tagゲームオブジェクトのタグ
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名

Public 関数

BroadcastMessageゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。
CompareTagこのゲームオブジェクトは tag とタグ付けされているかどうか
GetComponentゲームオブジェクトに type がアタッチされている場合は type のタイプを使用してコンポーネントを返します。ない場合は null です
GetComponentInChildren GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを取得します。
GetComponentInParent GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを取得します。
GetComponents GameObject から type のタイプのコンポーネントを「すべて」取得します。
GetComponentsInChildren GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを「すべて」取得します。
GetComponentsInParent GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを「すべて」取得します。
SendMessageゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SendMessageUpwardsゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
GetInstanceIDオブジェクトのインスタンス ID を返します
ToStringReturns the name of the object.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeタイプから見つけたすべてのアクティブのオブジェクト配列を返します
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。