IRaptorLightBackend
Supplies the component on a placed RAPTOR light: a Bakery light when Bakery is installed, otherwise a Unity Light.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | interface | preview, since 0.1.0 |
RaptorLightBackends uses the backend that Owns a light, otherwise the active backend. The backend records Undo for every write; the caller owns the undo group.
public interface IRaptorLightBackendProperties
Caps
RaptorLightCaps Caps { get; }The values and light kinds this backend supports.
Id
string Id { get; }A stable id, also used as the registry key (for example "Bakery").
IsAvailable
bool IsAvailable { get; }Whether the backend's light components exist in this project.
Label
string Label { get; }A short display name.
Methods
ApplyPreset
void ApplyPreset(RaptorLight light, RaptorLightPreset preset)Writes preset's values to the light's existing component of the same family.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
preset | RaptorLightPreset | The preset. |
CaptureInto
void CaptureInto(RaptorLight light, RaptorLightPreset preset)Reads the light's current values into preset. Used by Save New and Push.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
preset | RaptorLightPreset | The preset. |
Configure
void Configure(GameObject go, RaptorLightPreset preset, Vector3 normal, float offset)Adds and configures the light component on a newly placed light. An Area light takes the preset's size and faces along normal.
| Parameter | Type | Description |
|---|---|---|
go | GameObject | The light's GameObject. |
preset | RaptorLightPreset | The preset. |
normal | Vector3 | The normal of the surface the light was placed on. |
offset | float | The distance from the surface. |
GlowComponent
Component GlowComponent(GameObject go)Returns the point-family light component on go (the one StampGlow adds), or null.
| Parameter | Type | Description |
|---|---|---|
go | GameObject | The light's GameObject. |
Returns: The component, or null.
IsArea
bool IsArea(RaptorLight light)Returns whether light has this backend's Area light.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
Returns: True for an Area light.
KeepsUnityLight
bool KeepsUnityLight(Light light)Returns whether light, a UnityEngine.Light on a light this backend owns, is the backend's own light and is kept when companion lights are stripped. The Bakery backend returns false, because RAPTOR's Bakery lights are bake-only and have no Light. The Unity backend keeps its Baked light and strips Realtime and Mixed ones.
| Parameter | Type | Description |
|---|---|---|
light | Light | The light. |
Returns: True to keep the light.
LightComponent
Component LightComponent(GameObject go)Returns this backend's light component on go, or null. The Light HUD records this component for undo.
| Parameter | Type | Description |
|---|---|---|
go | GameObject | The light's GameObject. |
Returns: The component, or null.
Owns
bool Owns(RaptorLight light)Returns whether light has this backend's light component.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
Returns: True if it has one.
Rebuild
bool Rebuild(RaptorLight light, RaptorLightPreset preset)Rebuilds the light component when preset's kind needs a different component family, or when the light has none.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
preset | RaptorLightPreset | The preset. |
Returns: False when the light already has the right family.
StampGlow
Component StampGlow(GameObject go, Color color, float intensity, float range)Adds an Omni point light for a Liquid glow and records Undo.
| Parameter | Type | Description |
|---|---|---|
go | GameObject | The light's GameObject. |
color | Color | The glow colour. |
intensity | float | The glow intensity. |
range | float | The glow range. |
Returns: The component, or null when the backend cannot place one.
TryCaptureValues
bool TryCaptureValues(RaptorLight light, out LightValues values)Reads the light's preset-level values.
| Parameter | Type | Description |
|---|---|---|
light | RaptorLight | The light. |
values | out LightValues | The captured values. |
Returns: False when the light has none of this backend's components.
WriteValues
void WriteValues(Component light, in LightValues values, RaptorLightCaps fields)Writes the fields of values to light, a component this backend owns. The kind is not written, and RaptorLightCaps.Size is handled by placement (the Area quad, RaptorLightPlacement.AreaQuadResize). Does not record Undo; record light before calling.
| Parameter | Type | Description |
|---|---|---|
light | Component | The light. |
values | in LightValues | The values. |
fields | RaptorLightCaps | Which values to write. |
Related types
- RaptorLightBackends: The light backend registry.
- RaptorLightPreset: A reusable light configuration asset for the Lights tool.
- RaptorLightCaps: The preset-level light values and light kinds a backend supports.
- LightValues: The preset-level values of a light, captured from a preset or from a placed light.