Skip to content

gilzoide/unity-gradient-rect

Repository files navigation

Gradient Rect

openupm

Unity UI components with color Gradients embedded in their meshes.

Features

  • Uses Unity's built-in Gradient class.
  • Supports additional color tint, 2D textures and sprites.
  • Supports custom materials and masking. Gradient colors are embedded in the generated meshes, the components will never mess with your materials.
  • Supports mesh modifiers, like Outline and Shadow.

How to install

Either:

  • Install using openupm:

    openupm add com.gilzoide.gradient-rect
    
  • Install via Unity Package Manager using the following URL:

    https://github.com/gilzoide/unity-gradient-rect.git#1.1.0
    

Components:

  • GradientRect: rectangle colored with Gradient colors.
  • GradientTexture: texture with configurable UV, tinted with Gradient colors.
  • GradientImage: sprite tinted with Gradient colors. UVs are automatically fetched from sprite data. Only simple filling is supported, no slicing nor tiling.