Skip to content

Instantly share code, notes, and snippets.

@weshardee
Last active April 24, 2016 17:09
Show Gist options
  • Save weshardee/fa19284b53bf5441ea38190b67d7d919 to your computer and use it in GitHub Desktop.
Save weshardee/fa19284b53bf5441ea38190b67d7d919 to your computer and use it in GitHub Desktop.
// Flat planes (quads) with textures that have transparency and need to be colored or faded. Combine with iTween animations for extremely smooth looking, fading UI elements! :)
Shader "2D/Texture Color Alpha"
{
Properties
{
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = ""
}
Category
{
ZWrite Off
Tags {"Queue" = "Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
SubShader
{
Pass
{
SetTexture[_MainTex] {Combine texture * constant ConstantColor[_Color]}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment