Agent Skill
2/7/2026

unity-light

Create and configure lights. Use *_batch skills for 2+ lights.

B
besty0728
97GitHub Stars
1Views
npx skills add Besty0728/Unity-Skills

SKILL.md

Nameunity-light
DescriptionCreate and configure lights. Use *_batch skills for 2+ lights.

name: unity-light description: "Unity lighting control. Use when users want to create or configure lights (Directional, Point, Spot, Area). Triggers: light, lighting, directional light, point light, spot light, shadows, intensity, 灯光, 光照, 阴影."

Unity Light Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ lights.

Skills Overview

Single ObjectBatch VersionUse Batch When
light_set_propertieslight_set_properties_batchConfiguring 2+ lights
light_set_enabledlight_set_enabled_batchToggling 2+ lights

No batch needed:

  • light_create - Create a light
  • light_get_info - Get light information
  • light_find_all - Find all lights (returns list)

Light Types

TypeDescriptionUse Case
DirectionalParallel rays, no positionSun, moon
PointOmnidirectional from a pointTorches, bulbs
SpotCone-shaped beamFlashlights, spotlights
AreaRectangle/disc (baked only)Windows, soft lights

Skills

light_create

Create a new light.

ParameterTypeRequiredDefaultDescription
namestringNo"New Light"Light name
lightTypestringNo"Point"Directional/Point/Spot/Area
x, y, zfloatNo0,3,0Position
r, g, bfloatNo1,1,1Color (0-1)
intensityfloatNo1Light intensity
rangefloatNo10Range (Point/Spot)
spotAnglefloatNo30Cone angle (Spot only)
shadowsstringNo"soft"none/hard/soft

Returns: {success, name, instanceId, lightType, position, color, intensity, shadows}

light_set_properties

Configure light properties.

ParameterTypeRequiredDescription
namestringNo*Light object name
instanceIdintNo*Instance ID (preferred)
r, g, bfloatNoColor (0-1)
intensityfloatNoLight intensity
rangefloatNoRange (Point/Spot)
shadowsstringNonone/hard/soft

light_set_properties_batch

Configure multiple lights.

unity_skills.call_skill("light_set_properties_batch", items=[
    {"name": "Light1", "intensity": 2.0},
    {"name": "Light2", "intensity": 2.0},
    {"name": "Light3", "intensity": 2.0}
])

light_set_enabled

Enable or disable a light.

ParameterTypeRequiredDescription
namestringNo*Light object name
instanceIdintNo*Instance ID
enabledboolYesEnable state

light_set_enabled_batch

Enable or disable multiple lights.

unity_skills.call_skill("light_set_enabled_batch", items=[
    {"name": "Torch1", "enabled": False},
    {"name": "Torch2", "enabled": False},
    {"name": "Torch3", "enabled": False}
])

light_get_info

Get detailed light information.

ParameterTypeRequiredDescription
namestringNo*Light object name
instanceIdintNo*Instance ID

Returns: {name, instanceId, path, lightType, color, intensity, range, spotAngle, shadows, enabled}

light_find_all

Find all lights in scene.

ParameterTypeRequiredDefaultDescription
lightTypestringNonullFilter by type
limitintNo50Max results

Returns: {count, lights: [{name, instanceId, path, lightType, intensity, enabled}]}


Example: Efficient Lighting Setup

import unity_skills

# BAD: 4 API calls
unity_skills.call_skill("light_set_properties", name="Light1", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light2", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light3", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light4", intensity=2.0)

# GOOD: 1 API call
unity_skills.call_skill("light_set_properties_batch", items=[
    {"name": "Light1", "intensity": 2.0},
    {"name": "Light2", "intensity": 2.0},
    {"name": "Light3", "intensity": 2.0},
    {"name": "Light4", "intensity": 2.0}
])

Common Light Setups

Outdoor Scene (Sun)

unity_skills.call_skill("light_create",
    name="Sun", lightType="Directional",
    r=1, g=0.95, b=0.85, intensity=1.2, shadows="soft"
)

Indoor Scene (Ceiling Light)

unity_skills.call_skill("light_create",
    name="CeilingLight", lightType="Point",
    y=3, r=1, g=0.98, b=0.9, intensity=1.5, range=10
)

Dramatic Spotlight

unity_skills.call_skill("light_create",
    name="Spotlight", lightType="Spot",
    y=5, intensity=8, spotAngle=25, shadows="hard"
)

Best Practices

  1. Use Directional light for main scene illumination
  2. Point lights for localized sources (lamps, fires)
  3. Spot lights for focused beams (flashlights, stage)
  4. Limit real-time shadows for performance
  5. Area lights require baking (not real-time)
  6. Use intensity > 1 for HDR/bloom effects
Skills Info
Original Name:unity-lightAuthor:besty0728