Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetColorArray

Get a named color array.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetColorArray(string)

Get a named color array.
public Color[] GetColorArray(string name)

Parameters

name

The name of the property.

Returns

Type

Description

Color[]

Remarks

It is just an alias to Material.GetVectorArray, only colors are cast to vectors. No sRGB-linear conversion is done during the function call.

GetColorArray(int)

Get a named color array.
public Color[] GetColorArray(int nameID)

Parameters

nameID

The name ID of the property retrieved by Shader.PropertyToID.

Returns

Type

Description

Color[]

Remarks

It is just an alias to Material.GetVectorArray, only colors are cast to vectors. No sRGB-linear conversion is done during the function call.

GetColorArray(string, List<Color>)

Fetch a named color array into a list.
public void GetColorArray(string name, List<Color> values)

Parameters

name

The name of the property.

The list to hold the returned array.

Remarks

The list will be resized to the array size, or cleared if such property doesn't exist. Memory allocation is guaranteed not to happen during the function call.

GetColorArray(int, List<Color>)

Fetch a named color array into a list.
public void GetColorArray(int nameID, List<Color> values)

Parameters

nameID

The name ID of the property retrieved by Shader.PropertyToID.

The list to hold the returned array.

Remarks

The list will be resized to the array size, or cleared if such property doesn't exist. Memory allocation is guaranteed not to happen during the function call.