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

function GetFloat (propertyName : String) : float

Description

Get a named float value.

See Also: SetFloat, Materials, ShaderLab documentation.

JavaScript
function Start() {
renderer.material.shader = Shader.Find(" Glossy");
print(renderer.material.GetFloat("_Shininess"));
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Start() {
renderer.material.shader = Shader.Find(" Glossy");
print(renderer.material.GetFloat("_Shininess"));
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Start():
renderer.material.shader = Shader.Find(' Glossy')
print(renderer.material.GetFloat('_Shininess'))