GetColor
Get a color from the property block.
읽는 시간 1분최근 업데이트: 한 달 전
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.