Gradient
This commit is contained in:
23
Assets/Scripts/Settings/ColorExtensions.cs
Normal file
23
Assets/Scripts/Settings/ColorExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public static class ColorExtensions
|
||||
{
|
||||
public static Gradient DefaultGradient()
|
||||
{
|
||||
Gradient gradient = new Gradient();
|
||||
GradientColorKey[] colorKeys = new GradientColorKey[2];
|
||||
colorKeys[0].color = Color.white;
|
||||
colorKeys[0].time = 0;
|
||||
colorKeys[1].color = Color.white;
|
||||
colorKeys[1].time = 1;
|
||||
GradientAlphaKey[] alphaKeys = new GradientAlphaKey[2];
|
||||
alphaKeys[0].alpha = 1;
|
||||
alphaKeys[0].time = 0;
|
||||
alphaKeys[1].alpha = 1;
|
||||
alphaKeys[1].time = 1;
|
||||
gradient.SetKeys(colorKeys, alphaKeys);
|
||||
return gradient;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Settings/ColorExtensions.cs.meta
Normal file
11
Assets/Scripts/Settings/ColorExtensions.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b994ac82f6ab6cd42bf64438e79d1965
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user