Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

name

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.

GetVector(int)

Get a vector from the property block.
public Vector4 GetVector(int nameID)

Parameters

nameID

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.