As mentioned in the Introduction to Shader in Unity, Unity provides tons of the Shader data types which can use to create fantastic visual effects. Here are more details on those types with examples:

Color

Properties {
  _MainColor ("Main Color", Color) = (1, 0, 0, 1)
  [HDR]_SecondaryColor ("Secondary Color", Color) = (1, 1, 1, 1)
}

Color is represented in the format in RGBA (R, G, B, Alpha), each value is between 0 and 1. If we want to have the HDR, we can add the attribute [HDR] in front of it.

HDR in Shader Color

With HDR, Intensity is enabled for us, and we can make the GameObject blooming in the Game.

Int

Properties {
  _Int("This is an Integer", Int) = 1
}

Allow to input value of integers. However, in the Materials' inspector, we can input decimal values, such 0.88, but in Shader, it can only be recognized an integer. I guess this is a bug from Unity.

Int in Shader

Float

Properties {
  _Int("This is an Integer", Int) = 1
  _Float("This is a Float", Float) = 0.5
}

Similar to Int.

Range

Properties {
  _TimeSpeed1 ("Time Speed 1", Range(10, 20.2)) = 11.0
  [PowerSlider(2)]_TimeSpeed2 ("Time Speed 2", Range(10, 1000)) = 11.0
  [IntRange]_TimeSpeed3("Time Speed 3", Range(0 , 5)) = 1
  [Toggle]_Float("Time Speed 4", Range(0 , 1)) = 1
 }

This is an important type which is widely used. Change the value between 10 and 20. Which can also be float type.

In the example above:

[PowerSlider(2)] is more suitable for big value selection, meaning if we move the nob to the right, more bigger value will be selected in a quick way.

[IntRange]: Only allow to select integers

[Toggle]: Only allow to choose on or off.

Vector

Properties {
  _Vector("ector", Vector) = (0,0,0,0)
}

Vector is a combination of 4 float values, can be used to present the coordianator or even color.

2D Texture

Properties {
  _MainTex1("2D Texture 1", 2D) = "white" {}
  [NoScaleOffset]_MainTex2("2D Texture 2", 2D) = "white" {}
}

Decide what kind of texture the game object can use, Unity does provides default values such as white, black, gray and bump. Bump is the normal line map. Tiling and Offset decides how the map works.

Tiling: how the texture repearts across a surface of a game object in the x and y directions. For instance, if you set the tiling of a texture to (2, 3), the texture will be repeated twice horizontally and three tims vertically across the surface.

Offset: how the texture scrolls across a surface of a game object. For example, if we set the offset of a texture to (0.5, 0.5), the texture will be shifted halfway to the right and halfway up the surface.

And if we to hide those attributes, we can use NoScaleOffset attribute.

Further

There are also two types we haven't covered yet in the article, which later we will use some real examples to demo that: 3D Texture and Cube Texture.