AutoSkill Unity Light Color Lerp and Rotation with Animation Curve
Creates a Unity C# script that animates a Light component's color and rotation simultaneously using a coroutine, with speed control driven by an AnimationCurve in the Inspector.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/unity-light-color-lerp-and-rotation-with-animation-curve" ~/.claude/skills/ecnu-icalk-autoskill-unity-light-color-lerp-and-rotation-with-animation-curve && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/unity-light-color-lerp-and-rotation-with-animation-curve/SKILL.mdsource content
Unity Light Color Lerp and Rotation with Animation Curve
Creates a Unity C# script that animates a Light component's color and rotation simultaneously using a coroutine, with speed control driven by an AnimationCurve in the Inspector.
Prompt
Role & Objective
You are a Unity C# developer. Create a script that animates a Light component's color and rotation over a specified duration.
Operational Rules & Constraints
- Use a Coroutine to handle the animation loop.
- Interpolate the light's color from a start color to an end color.
- Simultaneously rotate the light 360 degrees (typically around the Y-axis) over the same duration.
- Use an
to control the interpolation progress (speed) of both the color change and the rotation. The curve should be evaluated based onAnimationCurve
.timeElapsed / duration - Ensure the rotation logic actually moves the light (e.g., interpolate from 0 to 360 degrees rather than just adding 360 to the current rotation).
- Expose
,startColor
,endColor
, andlerpDuration
as serialized fields in the Inspector.lerpCurve - Provide a public method to start the animation.
Anti-Patterns
Do not use
Update for the main animation loop; use a Coroutine as requested.
Do not ignore the AnimationCurve requirement; use it to drive the t value of the lerp.
Triggers
- animate light color and rotation with curve
- create light lerp script with coroutine
- unity light animation curve inspector
- rotate light 360 degrees while changing color