Scripting
Namespace
The namespace
using ChocDino.UIFX;
Adding the ExtrudeFilter Component
Add the ExtrudeFilter component to your GameObject
// Add the component to your GameObject and set default properties
var extrude = AddComponent<ExtrudeFilter>();
extrude.Projection = ExtrudeProjection.Perspective;
extrude.Angle = 135f;
extrude.PerspectiveDistance = 0f;
extrude.Distance = 32f;
extrude.FillMode = ExtrudeFillMode.BiColor;
extrude.ColorFront = Color.grey;
extrude.ColorBack = Color.clear;
extrude.FillBlendMode = ExtrudeFillBlendMode.Multiply;
extrude.ScrollSpeed = 0f;
extrude.ReverseFill = false;
extrude.SourceAlpha = 1f;
extrude.CompositeMode = LongShadowCompositeMode.Normal;
extrude.Strength = 1f;
Adding the LongShadowFilter Component
Add the LongShadowFilter component to your GameObject
// Add the component to your GameObject and set default properties
var shadow = AddComponent<LongShadowFilter>();
shadow.Method = LongShadowMethod.Normal;
shadow.Angle = 135f;
shadow.Distance = 8f;
shadow.StepSize = 1f;
shadow.FrontColor = Color.black;
shadow.UseBackColor = false;
shadow.BackColor = Color.clear;
shadow.Pivot = 0f;
shadow.SourceAlpha = 1f;
shadow.CompositeMode = LongShadowCompositeMode.Normal;
shadow.Strength = 1f;
Adjusting gradient color in ExtrudeFilter Component
Adjusting gradient color
// Adjust the gradient color
// NOTE: That you have to assign the whole array (GradientColorKey[] or GradientAlphaKey[]) to Gradient. You can't just adjust the values of the individual keys without reassigning the entire array, otherwise it will not update.
var extrude = GetComponent<ExtrudeFilter>();
var gc = extrude.Gradient.colorKeys;
gc[0] = new GradientColorKey(new Color(Random.value, Random.value, Random.value, 1f), gc[0].time);
extrude.Gradient.colorKeys = gc;