GetColor
Get a color from the property block.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
GetColor(string)
Get a color from the property block.
public Color GetColor(string name)
Parameters
The name of the property.
Returns
Type | Description |
|---|---|
| Color |
Remarks
Returns (0, 0, 0, 0) if not found. If the value is previously set using MaterialPropertyBlock.SetColor, the returned value is converted from the currently active color space back to the sRGB color space.
Additional Resources: MaterialPropertyBlock.GetVector, MaterialPropertyBlock.SetVector, MaterialPropertyBlock.SetColor.
GetColor(int)
Get a color from the property block.
public Color GetColor(int nameID)
Parameters
The name ID of the property retrieved by Shader.PropertyToID.
Returns
Type | Description |
|---|---|
| Color |
Remarks
Returns (0, 0, 0, 0) if not found. If the value is previously set using MaterialPropertyBlock.SetColor, the returned value is converted from the currently active color space back to the sRGB color space.
Additional Resources: MaterialPropertyBlock.GetVector, MaterialPropertyBlock.SetVector, MaterialPropertyBlock.SetColor.