# Unity Area Light

Our Area Light can be used at runtime as well as in editor.

There are two ways you can create Area Light.

1. **Manually adding in editor**

* Create an empty **Game Object**

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/1.jpg" alt=""><figcaption><p>Empty game object</p></figcaption></figure>

* Add new component "**Real Light**"
* That's it. Now you can perform transform operations such as "Position, Rotation, Scale" and area light operations such as intensity, color etc.

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/2.jpg" alt=""><figcaption><p>Real Light</p></figcaption></figure>

2. **By using C#**

```csharp
private void AddAreaLight()
{
    const float width = 1f;
    const float height = 2f;
    const float intensity = 20f;
    var color = Color.yellow;
    
    var areaLight = RealMesh.AreaLight(width, height, intensity, color);

    areaLight.transform.position = new Vector3(1, 2, 1);
}
```

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/4.jpg" alt=""><figcaption><p>Simple example of creating area light</p></figcaption></figure>

<figure><img src="https://github.com/Realistic3D/RealAPI/blob/main/docs/readme/.gitbook/assets/3.jpg" alt=""><figcaption><p>Real API area light</p></figcaption></figure>
