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