Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Gradient

class in UnityEngine

/

Implemented in:UnityEngine.CoreModule

Description

Gradient used for animating colors.

no example available in C#

Note that the alpha and colors keys will be automatically sorted by time value and that it is ensured to always have a minimum of 2 color keys and 2 alpha keys.

Properties

alphaKeysAll alpha keys defined in the gradient.
colorKeysAll color keys defined in the gradient.
modeControl how the gradient is evaluated.

Constructors

GradientCreate a new Gradient object.

Public Methods

EvaluateCalculate color at a given time.
SetKeysSetup Gradient with an array of color keys and alpha keys.

Did you find this page useful? Please give it a rating: