Skip to content

Commit

Permalink
Merge pull request #59 from JasonMa0012/2.x
Browse files Browse the repository at this point in the history
Fix errors when adding a ramp preset
  • Loading branch information
JasonMa0012 authored Aug 9, 2024
2 parents 46398cd + e593c8d commit 9f9b299
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Runtime/LwguiGradient/LwguiGradient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public LwguiGradient(Color[] colors, float[] times)

public void Clear(ChannelMask channelMask = ChannelMask.All)
{
_curves ??= new List<AnimationCurve>();
for (int c = 0; c < (int)Channel.Num; c++)
{
if (!IsChannelIndexInMask(c, channelMask)) continue;
Expand All @@ -126,6 +127,7 @@ public void Clear(ChannelMask channelMask = ChannelMask.All)

public void DeepCopyFrom(LwguiGradient src)
{
_curves ??= new List<AnimationCurve>();
for (int c = 0; c < (int)Channel.Num; c++)
{
if (_curves.Count == c)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.jasonma.lwgui",
"version": "1.18.4",
"version": "1.18.5",
"displayName": "LWGUI",
"description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.",
"keywords": [
Expand Down

0 comments on commit 9f9b299

Please sign in to comment.