Material.GetVector Manual     Reference     Scripting  
Scripting > Runtime Classes > Material
Material.GetVector

function GetVector (propertyName : string) : Vector4

Description

Get a named vector value.

Four component vectors and colors are the same in Unity shaders. GetVector does exactly the same as GetColor just the input data type is different (xyzw in the vector becomes rgba in the color).

See Also: GetColor, SetVector.

JavaScripts
print(renderer.material.GetVector("_Color"));

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
print(renderer.material.GetVector("_Color"));
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
print(renderer.material.GetVector('_Color'))