diff --git a/Runtime/LwguiGradient/LwguiGradient.cs b/Runtime/LwguiGradient/LwguiGradient.cs index 83b79bd..af7cdc1 100644 --- a/Runtime/LwguiGradient/LwguiGradient.cs +++ b/Runtime/LwguiGradient/LwguiGradient.cs @@ -115,6 +115,7 @@ public LwguiGradient(Color[] colors, float[] times) public void Clear(ChannelMask channelMask = ChannelMask.All) { + _curves ??= new List(); for (int c = 0; c < (int)Channel.Num; c++) { if (!IsChannelIndexInMask(c, channelMask)) continue; @@ -126,6 +127,7 @@ public void Clear(ChannelMask channelMask = ChannelMask.All) public void DeepCopyFrom(LwguiGradient src) { + _curves ??= new List(); for (int c = 0; c < (int)Channel.Num; c++) { if (_curves.Count == c) diff --git a/package.json b/package.json index 2d53240..8987581 100644 --- a/package.json +++ b/package.json @@ -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": [